2
I have two options and the program should say which one was chosen, if the input is wrong should ask to repeat the request.
Problems: Option 2 repeats 2 times until right. Option 1 does not say a name that is not in script
print('''Choice your number
[1] Banana
[2] Apple ''')
option = int(input('Your option: '))
while option != 1 and 2:
print('Try again')
option = int(input('Your option: '))
if option == 1:
print('Banana choiced')
elif option == 2:
print('Apple choiced')
Possible duplicate of How to make the system display an error message when it is not number?
– Woss
@Andersoncarloswoss though it may sound, I don’t think it’s because she has a peculiarity that valid options are tested. I thought it might even be the same case as the one I answered earlier, but it’s a little different.
– Maniero
I’m suspicious to comment on, but certainly not.
– An. Jorge