|
发表于 2018-1-6 17:33:29
|
显示全部楼层
a=5.99
>>> b=str(a)
Traceback (most recent call last):
File "<pyshell#108>", line 1, in <module>
b=str(a)
TypeError: 'str' object is not callable【str()是系统自带的,你不能在用它的时候自己同时定义一个别的叫做str的变量,这样会冲突。】
>>> c=str(e90)
Traceback (most recent call last):
File "<pyshell#109>", line 1, in <module>
c=str(e90)
NameError: name 'e90' is not defined【e90没有定义】
>>> c=str(5e10)
Traceback (most recent call last):
File "<pyshell#110>", line 1, in <module>
c=str(5e10)
TypeError: 'str' object is not callable【str()是系统自带的,你不能在用它的时候自己同时定义一个别的叫做str的变量,这样会冲突。】
>>> a=5e10
>>> b=str(a)
Traceback (most recent call last):
File "<pyshell#112>", line 1, in <module>
b=str(a)
TypeError: 'str' object is not callable【str()是系统自带的,你不能在用它的时候自己同时定义一个别的叫做str的变量,这样会冲突。】
①你可以将str()改为str1()
②e90需要先定义一下 |
|