我是编程新手,我决定制作一个基本的数学游戏。我开始 print ("what is your name") name = input () print ("hello" + name +" 我是 steve,这是我的数学测试。你准备好了吗?Y/N") answer_1 = input () answer_1 = int (answer_1)
if answer_1 ==Y:
print ("Good then lets get started")
else:
print ("well you have started now so to late lets go")
我去测试它,每次我都得到这个。
what is your name
Callum
hello Callum i am steve and this is my maths test. Are you ready? Y/N
Y
Traceback (most recent call last):
File "C:\Users\callum\Documents\programming\maths test.py", line 6, in <module>
answer_1 = int (answer_1)
ValueError: invalid literal for int() with base 10: 'Y'
>>>
谁能告诉我我做错了什么