From d83274f315f84703c2804026362f82e4a56580e6 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Tue, 8 Feb 2022 21:10:00 -0600 Subject: [PATCH] Fix invalid choice bug --- main.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 798ddf6..bf58baf 100644 --- a/main.py +++ b/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 while True: + print("""Would you like to convert from +1. Decimal to binary +2. Binary to decimal + """) + # Get choice + choiceIn = int(input()) match choiceIn: case 1: convertToBinary = True