print type(str(1)) is str,
print type('1') is str,
print type(repr(1)) is str,
print type(str([1,2,3])) is str,
print isinstance(repr(123),str)
#output True True True True True
str() 的输出对用户比较友好,而repr()的输出对python比较友好。三者输出的内容一样,但是用
eval()把字符串当成表达式来求值。
eval(repr('abc'))=='abc'
#output True