Guessing Number Python Game
#!/usr/bin/python
import random
computerGuess=random.randint(0,100)
while True:
userGuess=int(input("Guess a number between 0 - 100: "))
if userGuess > computerGuess:
print ("Guess Lower")
elif userGuess < computerGuess:
print ("Guess Higher")
else:
print ("Congrate, You are correct.")
break
No comments:
Post a Comment