We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
import random
def display_menu(): print("Welcome to Guessing Game Puzzle") print("1. Select Level") print("2. Exit")
def game_level(): print("Choose your game level") print("3. Easy") print("4. Hard")
def play_game(chances): number = random.randint(1, 100) print("Guess the number: ") while chances > 0: guess_number = int(input()) if guess_number < number: print("Number too low") elif guess_number > number: print("Number too high") elif guess_number == number: print("You win!") break print("Number of chances left: ", chances) chances -= 1 if chances == 0: print("You lose!")
def main(): display_menu() choice = int(input("Enter your preference: ")) if choice == 1: game_level() level = int(input("Enter your preferred level: ")) if level == 3: play_game(10) elif level == 4: play_game(5) else: print("Wrong input") elif choice == 2: print('Exiting game') else: print("Try again")
if name == "main": main()
Sorry, something went wrong.
Nice
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: