Language:
Contact Us

Search

Pyrthon Projects

  • Share this:

Gussing Game (Human)

import random

intro = input("Welcome to Dhruv's number guessing game! Press c to continue and q to quit: ")
if intro == "Q" or intro == "q":
    quit()
    
play = "Y"
guess = 0
while play == "Y" or play == "y":
    number = random.randint(1,100)
    while guess != number:
        guess  = int(input("Guess the number: "))
        if guess == number:
            print("Congratulations")
            continue
        elif guess < number:
            print("Higher required!")
        else:
            print("Lower required!")
    play = input("Enter Y to play again any other key to continue: ")
 

Raz Manva

Raz Manva