Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Just a bit confused
#2
this:
1 = int(input("Savanah")
2 = int(input("ThinMints")
3 = int(input("Tagalongs")
is taboo.
You are essentially trying to override the numbers 1, 2 and 3
do this like:
choice = 0
while choice not in [1, 2, 3]:
    print('Please choose one of:')
    print("    1. Savanah")
    print("    2. ThinMints")
    print("    3. Tagalongs")
    choice = int(input())
print('You have chosen option: {}',format(choice))
Reply


Messages In This Thread
Just a bit confused - by TimeForged - Feb-09-2018, 10:40 PM
RE: Just a bit confused - by Larz60+ - Feb-09-2018, 11:03 PM
RE: Just a bit confused - by TimeForged - Feb-09-2018, 11:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  i'm confused with this if-else assignment gabejohnsonny21 4 2,832 Mar-14-2020, 03:56 PM
Last Post: gabejohnsonny21

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020