Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- zgadnij = 0
- odpowiedz = 0
- wybor = ''
- values = {
- '1': random.randint(1,10),
- '2': random.randint(1,20),
- '3': random.randint(1,30)
- }
- wybor = raw_input('Podaj poziom trudnosci: ')
- zgadnij = values.get(wybor, 'Nie ma takiego poziomu trudnosci')
- print(zgadnij)
- while odpowiedz != zgadnij:
- odpowiedz = input('Podaj liczbe z przedzialu 1-10\n')
- if odpowiedz > zgadnij:
- print 'Podana liczba jest za duza'
- continue
- elif odpowiedz < zgadnij:
- print 'Podana liczba jest za mala'
- continue
- else:
- print 'Brawo! Zgadles!'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement