In: Computer Science
In many programming languages you can generate a random number between 1 and a limiting value named LIMIT by using a statement similar to randomNumber = random(LIMIT). Create the logic for a guessing game in which the application generates a random number and the player tries to guess it. Display a message indicating whether the player’s guess was correct, too high, or too low. (After you finish Chapter 4, you will be able to modify the application so that the user can continue to guess until the correct answer is entered.)
import random
RandomNumber = int((random.randint(1,100)))
#the range is from 1 to 100
RandomNumber1 = int(input("enter a RandomNumber:"))
#Logic to perform random RandomNumberber game Logic
if(RandomNumber <= RandomNumber1):
print("the RandomNumber",RandomNumber," is lower
than", RandomNumber1)
elif(RandomNumber1 == RandomNumber):
print("the RandomNumbers",RandomNumber, "are
equal")
else:
print("the RandomNumber",RandomNumber, "is
higher than", RandomNumber1)
Thank You...!