Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #!usr/bin/python
  2. # filename :guessgame.py
  3.  
  4. n = 23
  5. running = True
  6.  
  7. while running :
  8. guess =input('Enter an interger xy less than 100 : ')
  9. if guess == n :
  10. s = '''congrats.
  11. you won a banana.'''
  12. print s
  13. running = False # this causes the while loop to stop
  14. if guess > 100:
  15. break
  16. if guess != n :
  17. p = '''try again.
  18. x+y=5'''
  19. print p
  20. else:
  21. print 'The while loop is over.'
  22. #Do anything you want to do her
  23. raw_input("press<enter>")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement