gpt4 book ai didi

python - “bool”对象不可调用

转载 作者:太空宇宙 更新时间:2023-11-03 18:02:19 27 4
gpt4 key购买 nike

Traceback (most recent call last):
File "C:\Python\ZombieGameImages\ZombielandI_NLoo.py", line 27, in <module>
gm.over(True)
TypeError: 'bool' object is not callable

if gm.time<1: #function that causes error
gm.over(True)

当我尝试在程序中使用 if gm.time<1 时,会出现上述错误。我在学校学习Python,所以我对Python还是新手。帮忙?

最佳答案

gm.over 是 bool 类型,你可以像方法一样调用它......像这样设置:

gm.over = True

关于python - “bool”对象不可调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27479042/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com