From 083376ae795904c1487383fa97964b326e812da7 Mon Sep 17 00:00:00 2001 From: Ishika Casley Date: Wed, 5 Mar 2025 21:52:44 +0530 Subject: [PATCH] Fix #7: Added restart game option after quitting --- main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index e6e412c..055f8ad 100644 --- a/main.py +++ b/main.py @@ -147,7 +147,10 @@ def main(): break balance += spin(balance) - print(f"You left with ${balance}") - + # ✅ Ask the player if they want to play again + restart = input("Do you want to play again? (y/n): ") + if restart.lower() != "y": + print(f"You left with ${balance}") + return # Exit the function, stopping the game main()