Guessing Game - Between You and Computer
Guess the number?
import random
rNum = random.randint(1, 100)
while True:
gn = int(input("We have chosen a number between 1 and 100. Guess what? "))
if gn < rNum:
print("Choose higer number")
if gn > rNum:
print("Choose lower number")
if gn == rNum:
print(f"You guessed it right. Your number was {gn}")
print(f"Our chosen number was {rNum}")
break
Comments
Post a Comment
Write something to CodeWithAbdur!