Hello there,
I'm trying make a simple code (to practice for loops and if/elif statements) to give a person 3 choices of what kind of book he is looking for. He can do this three times (attempt).
My problem is that no matter what I enter 1.,2. or 3 it returns "you picked Non fiction.
Can someone please tell me what I'm doing wrong?
(after trying to figure out myself the problem for about a half an hour it is quite aggravating)
Thank you very much
Shevach
I'm trying make a simple code (to practice for loops and if/elif statements) to give a person 3 choices of what kind of book he is looking for. He can do this three times (attempt).
My problem is that no matter what I enter 1.,2. or 3 it returns "you picked Non fiction.
Can someone please tell me what I'm doing wrong?
(after trying to figure out myself the problem for about a half an hour it is quite aggravating)
Thank you very much
Shevach
for attempt in range (3): print('What kind of book are you looking for?') print('1. Non fiction') print('2. Fiction') print('3. Text book') type=input() if type=='1'or 'Non fiction': print('You picked Non fiction') elif type=='2'or'Fiction': print('you picked Fiction') elif type== '3' or 'Text book': print('you picked Text book') else: print('Try again')