My son wrote a code, it's quite simple but second if statement isn't working as expected.
print ('hi')
print ('How are you?')
print ('Hope ok!')
print ('So I will ask you a few questions')
print ('What is 2 + 2?')
answer = input()
if answer == 4:
print ('Well done!')
else:
print ('Are you able to count?')
print ('Well anyway.Another question.')
print ('What is 50 % 50?')
anser = input()
if anser == 1:
print ('Well done!')
elif anser == 5:
print ('What?')
elif anser == 50:
print ('Who are you? Are you already in 1st class?')
else:
print ('Ok.I got you.You cannot count.')
print ('Арролбьітрцо')
print ('The code is broken! can you fix it?')
print ('Press Enter')
input()
for i in range (1,70):
print ('Error')
It doesn't matter what second answer is, program still prints
"Ok.I got you.You cannot count. Арролбьітрцо The code is broken! can you fix it? Press Enter"
even if you type 1 or 5...
Can anyone suggest please what is wrong.
Thank you.