convert number to string in python

后端 未结 5 1531
你的背包
你的背包 2021-01-26 17:40

I meet a problem about converting number to string.

I want to get a string \"0100\" from str(0100), but what I got is \"64\". Does any way I can do to get a string \"010

5条回答
  •  情歌与酒
    2021-01-26 17:54

    You could just concatenate both strings so if you want 0100

    res = str(0) + str(100)
    

    that way res = '0100'

提交回复
热议问题