Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- num = randint(0,10)
- guess = 0
- count = 0
- while guess != 'exit' and guess != num:
- guess = raw_input("What's your guess?")
- if guess == 'exit':
- break
- guess = int(guess)
- count += 1
- if guess < num:
- print "you guessed too low!"
- elif guess > num:
- print "you guessed too high!"
- else:
- print "Congracts you got it!"
- print "it only took you %d tries!" % count
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement