[英]Builtin function not working with Spyder
I'm trying to use the max function in Python 3,6: 我正在尝试在Python 3,6中使用max函数:
print('Maximum is:', max(1, 3, 2, 5, 4))
And the result is 结果是
File "E:/ProgramyRobione/untitled1.py", line 2, in <module>
print('Maximum is:', max(1, 3, 2, 5, 4))
TypeError: 'int' object is not callable
I'm using Spyder and that line is all that code should do. 我正在使用Spyder,而这行代码应做的所有事情。
This is a bit of an iPython headshot that comes with Spyder. 这是Spyder附带的iPython头像。 I've fallen foul of this when copy/pasting random bits of code from SO to test only to find really odd behaviour several days later - variables defined in the iPython console will also be in the script's global namespace indefinitely. 几天后,当我从SO复制/粘贴代码的随机位以进行测试以仅发现真正奇怪的行为时,我就犯规了-在iPython控制台中定义的变量也将无限期地存在于脚本的全局命名空间中。
There's two things you can do: 您可以做两件事:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.