tt=322
tem='%d' %tt
'%f' % 1234.567890 输出:'1234.567890'
'%.2f' % 1234.567890 输出:'1234.57'
str(5)
>>> '10'+str(4)
'104'
>>> str='hello'
>>> '10'+str(4)
Traceback (most recent call last):
File "", line 1, in
'10'+str(4)
TypeError: 'str' object is not callable
>>>
欢迎光临 大内高手社区 (https://bbs.tedu.cn/) | Powered by Discuz! X3.4 |