Guess the number game
Super simple python game in which a random number is generated and the goal is for the user to guess the number correctly between 1-10.
Here is all the code:
#The Random Number Generator Game
#import Funtion
import random
#listing Variable
number = random.randrange(1, 10)
# ask user for random number
usr = int(input("\n\nHello welcome to the game!\n\n\nPlease input a number between 1-10 : "))
# if function
if number == usr:
print("\n\nCongrats you guessed the number!" + "\n\n ")
else:
print("\n\nsorry you are wrong the number was " + str(number) + " :( \n\n ")
If you want to view this code and some of my other projects you can visit my GitLab