Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import random
- def ugani_stevilo():
- stevilo = random.randint(1, 200)
- print "Mrzlo - Vroče"
- while True:
- poskus = int(raw_input("Ugani stevilo med 1 in 200:"))
- if poskus == stevilo:
- print "Bravo! Uganil si število!"
- print "Za nagrado dobiš keks!"
- break
- elif poskus < stevilo and poskus >= (stevilo - 5) or poskus > stevilo and poskus <= (stevilo + 5):
- print "Peklensko vroče!"
- elif poskus < (stevilo - 5) and poskus >= (stevilo - 15) or poskus > (stevilo + 5) and poskus <= (stevilo + 15):
- print "Vroče!"
- elif poskus < (stevilo - 15) and poskus >= (stevilo - 25) or poskus > (stevilo + 15) and poskus <= (stevilo +25):
- print "Toplo!"
- elif poskus < (stevilo - 25) and poskus >= (stevilo - 40) or poskus > (stevilo + 25) and poskus <= (stevilo + 40):
- print "Hladno!"
- elif poskus < (stevilo - 40) and poskus >= (stevilo - 60) or poskus > (stevilo + 40) and poskus <= (stevilo + 60):
- print "Mrzlo!"
- elif poskus < (stevilo - 60) or poskus > (stevilo + 60):
- print "Ledeno mrzlo!"
- else:
- print "Narobe! Poskusi znova!"
- ugani_stevilo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement