不小心对内置函数赋值了,怎么取消?
本帖最后由 橘猫啊啊 于 2020-5-31 23:49 编辑不小心对内置函数赋值,怎么取消?
刚看小甲鱼的第3节课,有这样的疑问,希望有大神可以看看我{:5_105:}
发代码吧....还有 内置函数是怎么个赋值法???懵 del 函数名 txxcat 发表于 2020-5-31 23:49
>>> print = 'pick'
>>> name ='me'
>>> print(name)
Traceback (most recent call last):
File "<pyshell#29>", line 1, in <module>
print(name)
TypeError: 'str' object is not callable
橘猫啊啊 发表于 2020-5-31 23:52
>>> print = 'pick'
>>> name ='me'
>>> print(name)
重新运行IDLE 就没事了 Twilight6 发表于 2020-5-31 23:49
发代码吧....还有 内置函数是怎么个赋值法???懵
>>> print = 'pick'
>>> name ='me'
>>> print(name)
Traceback (most recent call last):
File "<pyshell#29>", line 1, in <module>
print(name)
TypeError: 'str' object is not callable Twilight6 发表于 2020-5-31 23:53
重新运行IDLE 就没事了
如果前面写了很多代码怎么办呢 本帖最后由 Twilight6 于 2020-6-1 00:06 编辑
橘猫啊啊 发表于 2020-5-31 23:54
如果前面写了很多代码怎么办呢
写较多的代码建议别在Shell里面,一般在.py脚本里面写ctrl + n 可以创建脚本文件 橘猫啊啊 发表于 2020-5-31 23:52
>>> print = 'pick'
>>> name ='me'
>>> print(name)
del print Twilight6 发表于 2020-5-31 23:57
写较多的代码建议别在Shell里面,一般在.py脚本里面写ctrl + n 可以创建脚本文件
谢谢您嘻嘻,这一步我还没学到,但是还是非常感谢您的解答 txxcat 发表于 2020-5-31 23:58
get到啦谢谢
页:
[1]