Python 之 str 、 repr 、 反引号(``)的区别

str 、 repr 、 `` 、是将Python值转换为字符串的3种方式ide

print str("Hello, World !")
hello, world !code

print repr("Hello, World !")
'Hello, World !'字符串

temp = 2
print "The number is " + temp
The number is 2it

相关文章
相关标签/搜索