Browse Source

Fix invalid choice bug

master
Abheek Dhawan 3 years ago
parent
commit
d83274f315
Signed by: abheekd GPG Key ID: 7BE81B8C14475B67
  1. 13
      main.py

13
main.py

@ -10,16 +10,15 @@ print(''' ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/_______\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\| |/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/_______\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|
''') ''')
print("""Would you like to convert from
1. Decimal to binary
2. Binary to decimal
""")
# Get choice
choiceIn = int(input())
# Get 1 or 2, if neither then keep looping # Get 1 or 2, if neither then keep looping
while True: while True:
print("""Would you like to convert from
1. Decimal to binary
2. Binary to decimal
""")
# Get choice
choiceIn = int(input())
match choiceIn: match choiceIn:
case 1: case 1:
convertToBinary = True convertToBinary = True

Loading…
Cancel
Save