-
问题是你习惯了
rules()
就像传递函数的参数一样。您需要更改为:
inputCheck("Do you know the rules?\n", rules, "Ok. Starting game...")
.
规则():将调用函数规则()
规则:函数可以作为参数传递给另一个函数。
您可以来这里获取更多信息:
What is the difference between calling function with parentheses and without in python?
.
笔记
:我看到你的示例代码有很多错误(当使用
def rules()
例如一个对象或函数)。你应该学习如何调试,它将帮助你有效地修复错误