Quotes help make search much faster. Example: "Practice Makes Perfect"

Thursday, November 29, 2012

Codecademy: Your own while / else


#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!"

1 comment:


This is an example of scrolling text using Javascript.

Popular Posts