我只是一个初学者,所以请容忍我,我有麻烦我的如果和打印声明。有3种选择,A、B或C,这是A:
g = 0
ge = ("Gold =")
gh = ("The amount of gold you have is:")
choice3 = input()
if choice3 == "A":
print("You slide him the coins through the bars.")(g = g - 5)(gh,g)("'Thanks!' He says. You manage to break out with him and escape to New Mexico, Well done, you win!")
这是我收到的错误消息:
^{pr2}$
这是因为
print
总是在调用后返回None
。见下文:通常,Python会忽略这个
None
。但是,它是存在的,因为Python中的所有函数都必须返回某些。在此外,在这一部分:
^{pr2}${{{{like^{cd6}调用函数返回。在
请记住,Python中的函数是通过在函数后面加上
(...)
来调用的。在Here是关于
print
的参考资料,我想对你有帮助。在您不应该像那样使用print,而是使用
format
例如,shown here在您的情况下,可能是:
^{pr2}$相关问题 更多 >
编程相关推荐