Q:

guess game using python programming

0

using while loop, write python game for guessing numbers from user.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using while loop:

correctNumber=int(input("please enter the number "))
running=True
while running==True:
    guess=int(input("enter your guess:"))
    if guess==correctNumber:
        print("congratulations,, you guessed it!")
        running=False
    elif guess>correctNumber:
        print("wrong number, your number is bigger than correct number")
    else: print("wrong number, your number is smaller then correct number")

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now