Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!usr/bin/python
- # filename :guessgame.py
- n = 23
- running = True
- while running :
- guess =input('Enter an interger xy less than 100 : ')
- if guess == n :
- s = '''congrats.
- you won a banana.'''
- print s
- running = False # this causes the while loop to stop
- if guess > 100:
- break
- if guess != n :
- p = '''try again.
- x+y=5'''
- print p
- else:
- print 'The while loop is over.'
- #Do anything you want to do her
- raw_input("press<enter>")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement