NUMBER GUESSING GAME CODE FOR BEGINNERS

import random
print("Here You Have To Guess The Numbers From 0-10")
print("If You Got right You will Get a Point")
print("if you want to exit type 12")
score = 0
while True:
    number = int(input("Enter The Number You Guessed Here: "))
    a = random.randrange(10)
    if number == a:
        score = score+1
        print("miracle You Got Right Answer.")
    elif number == None:
        pass
    elif number == 12:
        print(f"Here is Your Score {score}")
        print("now i am quitting it")
        exit()
    else:
        print("TRY YOUR BEST BRO")
    print(f"actual number {a}")

Comments

Popular posts from this blog

MY FIRST MYSQL PROJECT I EVER MADE

CALCULATING FACTORIALS IN PYTHON LANGUAGE

A SIMPLE GAME FOR A BEGINNER IN PYTHON WITH ONLY TWO MODULES