import random x = random.randint(1,100) tipp = 0 db=0 while tipp != x: tipp = int(input("Tippelj: ")) db = db+1 if tipp > x: print("Kisebb számra gondoltam.") elif tipp < x: print("Nagyobb számra gondoltam.") else: print("ELTALÁLTAD! Próbálkozásaid száma: ",db)