0% found this document useful (0 votes)
7 views1 page

Number Guessing Game Code

Uploaded by

Mahin Tayyab
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Number Guessing Game Code

Uploaded by

Mahin Tayyab
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

import random

target_number = [Link](1,100)

guess = 0

while guess != target_number:

guess = int(input("Guess the number (between 1 and100):"))

if guess < target_number:

print("Too low! Try again.")

elif guess > target_number:

print("Too high! Try again.")

else:

print(f"Congratulations! You guessed correct number {target_number}.")

You might also like