Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import random
  3.  
  4. def ugani_stevilo():
  5. stevilo = random.randint(1, 200)
  6.  
  7. print "Mrzlo - Vroče"
  8.  
  9. while True:
  10. poskus = int(raw_input("Ugani stevilo med 1 in 200:"))
  11. if poskus == stevilo:
  12. print "Bravo! Uganil si število!"
  13. print "Za nagrado dobiš keks!"
  14. break
  15. elif poskus < stevilo and poskus >= (stevilo - 5) or poskus > stevilo and poskus <= (stevilo + 5):
  16. print "Peklensko vroče!"
  17. elif poskus < (stevilo - 5) and poskus >= (stevilo - 15) or poskus > (stevilo + 5) and poskus <= (stevilo + 15):
  18. print "Vroče!"
  19. elif poskus < (stevilo - 15) and poskus >= (stevilo - 25) or poskus > (stevilo + 15) and poskus <= (stevilo +25):
  20. print "Toplo!"
  21. elif poskus < (stevilo - 25) and poskus >= (stevilo - 40) or poskus > (stevilo + 25) and poskus <= (stevilo + 40):
  22. print "Hladno!"
  23. elif poskus < (stevilo - 40) and poskus >= (stevilo - 60) or poskus > (stevilo + 40) and poskus <= (stevilo + 60):
  24. print "Mrzlo!"
  25. elif poskus < (stevilo - 60) or poskus > (stevilo + 60):
  26. print "Ledeno mrzlo!"
  27. else:
  28. print "Narobe! Poskusi znova!"
  29.  
  30. ugani_stevilo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement