vendredi 3 septembre 2021

im writing a python for loop in which the program asks a question, and if the user inputs a certain answer, the program will display a certain message

here is the code:

MyArray = []
question = []
for i in range(3):
    question = input("what is 2+2 ")
    if question != '2':
       print('wrong')
    elif question != 'yes':
       print('wrong ')
    MyArray.append(question)

print(MyArray)

I entered both 2 and yes, but it the program kept saying 'wrong' each time

bear with me since I'm new to programming

Aucun commentaire:

Enregistrer un commentaire