Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random, os
- os.system("clear")
- print("Pomyslalem liczbe od 1 do 100\n")
- traf = False
- liczba = random.randint(1,101)
- liczProb = 1
- print(liczba)
- while traf == False:
- proba1 = input("Zgadnij: ")
- os.system("clear")
- try: proba = int(proba1)
- except:
- print("To nie liczba!")
- proba = None
- if type(proba) == int:
- if proba < liczba: print("Za mało, spróbuj jeszcze raz\n")
- elif proba > liczba: print("Za dużo, spróbuj jeszcze raz\n")
- elif proba == liczba:
- print("Brawo! Wygrałeś w " + str(liczProb) + " probie!")
- traf = True
- liczProb += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement