diff --git a/european_roulette.py b/european_roulette.py index 4ab9d86..44cec02 100644 --- a/european_roulette.py +++ b/european_roulette.py @@ -292,7 +292,6 @@ def build_a_list_of_wager_types(): selected_key = input("Enter a wager type (e.g. S3): ").strip().upper() if selected_key not in globals(): print(f"'{selected_key}' is not defined.") - selected_key = input("Please enter a wager type to continue. ") continue else: wager_dict = globals()[selected_key] @@ -465,14 +464,21 @@ def keep_playing(): def main(): - holdings = int(input("Enter your initial holdings at the start of play (e.g. 1000 for $1000): ")) - global playing - global DEBUG - global wagers + holdings = input("Enter your initial holdings at the start of play (e.g. 1000 for $1000): ") + if not is_convertible_to_int(holdings): + print("You must enter an integer for your holdings.") + holdings = None + main() + else: + holdings = int(holdings) + global playing + global DEBUG + global wagers while playing: display_board() + print(f"Your holdings before the spin is ${holdings}") # User selects which dictionaries to search for number the wheel returns wager_type_list = build_a_list_of_wager_types() number = spin_wheel()