+ 1

Could someone find the mistake, i ran this script but it printed incorrectly i guess

money = 5000 print("money: ",money) b = str(input("input: ")) print(b) print("-coffee 2000\n-gundam 10000 \n") if b=="coffee" or "Coffee": money-=2000 if money<0: print("you dont have enough money") else: print("your money: ",money) elif b=="gundam" or "Gundam": money-=10000 if money<0: print("you dont have enough money") else: print("your money: ",money) else: print("error")

20th May 2019, 12:39 PM
ENDERllama 15
ENDERllama 15 - avatar
2 odpowiedzi
+ 2
after "or" you need whole expression so b=="coffee" or b=="Coffee" the same with "gundam"
20th May 2019, 12:43 PM
Hubert Dudek
Hubert Dudek - avatar
0
Ok thanks
20th May 2019, 12:49 PM
ENDERllama 15
ENDERllama 15 - avatar