hello im new to python and im just making simple programs(for now)
so im doing this guessing game where the user enter a number and tells him if he got it right or not.
here is the code
import random
import re
print 'This is a guessing game'
def game(guess):
x=random.randint(1,100)
respond=input(guess)
if respond < x:
print 'nop higher'
elif respond > x:
print 'wow too much'
if respond == x:
print 'you got it!!'
print 'the number was ' + x
game("Guess a number: ")
i cant figure out how to loop it. it just does it once and thats it.
Any help is appreciated
Thanks in advance