2024-05-16 21:06:38 发布
网友
我正在为闪存卡测试编写一些代码,但是当我运行程序时,它在这行中显示TypeError: 'NoneType' object is not callable:
TypeError: 'NoneType' object is not callable
letter = print("Enter letter of your choice (A B C): ").upper()
我认为您试图将“print”的输出赋给一个变量会导致错误。你知道吗
print用于打印文本,而不是用于文本输入。你知道吗
print
要进行文本输入,请使用input(如果使用python2,则使用raw_input):
input
raw_input
letter = input("Enter letter of your choice (A B C): ").upper()
我认为您试图将“print”的输出赋给一个变量会导致错误。你知道吗
print
用于打印文本,而不是用于文本输入。你知道吗要进行文本输入,请使用
input
(如果使用python2,则使用raw_input
):相关问题 更多 >
编程相关推荐