def scitani (a,b): return a+b def odcitani(a,b): return a-b def nasobeni(a,b): return a*b def deleni(a,b): if b == 0: raise ZeroDivisionError() else: return a/b while True: userInputA = int(input("Zadej číslo: ")) userInputB = int(input("Zadej číslo: ")) userChoice = int(input("Zvol matematickou operaci: 1 - sčítání, 2 - odčítání, 3 - násobení, 4 - dělení: ")) result= 0 if userChoice == 1: result = scitani(userInputA, userInputB) elif userChoice == 2: result = odcitani(userInputA, userInputB) elif userChoice == 3: result = nasobeni(userInputA, userInputB) elif userChoice == 4: result = deleni(userInputA, userInputB) else: raise ValueError("Hele, co mi sem zadáváš číslo, které jsem ti nenabídl!") print("Výsledek je: " + str(result)) systemChoice = int(input("Chceš pokračovat? 0 - NE, 1 - ANO: ")) if systemChoice == 0: break