2011-02-12, 11:19 PM
Alley Wrote:You can't have 2 else statements in a definition. Its okay, I'll just copy it from a friend or something.. Thanks for trying.
I swear this should work:
Code:
from random import randint
rnum = randint(1,20)
print rnum
for i in range(1, 4):
guess = input("Guess a number : ")
if guess == rnum:
print "You got it!"
break
else:
if i < 3:
print "Guess again!"
else:
print "Used up all 3 guesses"

