Python AttributeError:'非类型'

2024-05-16 21:06:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在为闪存卡测试编写一些代码,但是当我运行程序时,它在这行中显示TypeError: 'NoneType' object is not callable

letter = print("Enter letter of your choice (A B C): ").upper()

Tags: of代码程序yourobjectisnot闪存卡
2条回答

我认为您试图将“print”的输出赋给一个变量会导致错误。你知道吗

print用于打印文本,而不是用于文本输入。你知道吗

要进行文本输入,请使用input(如果使用python2,则使用raw_input):

letter = input("Enter letter of your choice (A B C): ").upper()

相关问题 更多 >