Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. import random
  2.  
  3. zgadnij = 0
  4. odpowiedz = 0
  5. wybor = ''
  6.  
  7. values = {
  8.             '1': random.randint(1,10),
  9.             '2': random.randint(1,20),
  10.             '3': random.randint(1,30)
  11.          }
  12. wybor = raw_input('Podaj poziom trudnosci: ')
  13. zgadnij = values.get(wybor, False)
  14. while odpowiedz != zgadnij:
  15.     odpowiedz = input('Podaj liczbe: \n')
  16.     if odpowiedz > zgadnij:
  17.         print 'Podana liczba jest za duza'
  18.         continue
  19.     elif odpowiedz < zgadnij:
  20.         print 'Podana liczba jest za mala'
  21.         continue
  22.     else:
  23.         print 'Brawo! Zgadles!'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement