#sample solution
from random import randrange
random_number = randrange(1, 10)
count = 0
#start your game!
while count<3:
print "Turn " + str(count+1) + ":"
count = count + 1
guess = int(raw_input("Enter a guess:"))
if guess == random_number:
print "You win!"
break
else:
print "You lose!"
from random import randrange
random_number = randrange(1, 10)
count = 0
#start your game!
while count<3:
print "Turn " + str(count+1) + ":"
count = count + 1
guess = int(raw_input("Enter a guess:"))
if guess == random_number:
print "You win!"
break
else:
print "You lose!"
This comment has been removed by the author.
ReplyDelete