Kalkulačka umí i jiné operátory
This commit is contained in:
parent
c3db89a363
commit
d89434c869
1 changed files with 11 additions and 1 deletions
|
@ -1,4 +1,14 @@
|
|||
a = int(input("Zadej prvni cislo"))
|
||||
b = int(input("Zadej druhe cislo"))
|
||||
|
||||
print("Souce je", a + b)
|
||||
operator = input("Zadej operátor")
|
||||
if operator == '+':
|
||||
print("Součet je", a + b)
|
||||
elif operator == '-':
|
||||
print("Rozdíl je", a - b)
|
||||
elif operator == '*':
|
||||
print("Součin je", a * b)
|
||||
elif operator == '/':
|
||||
print("Podíl je", a // b)
|
||||
else:
|
||||
print("Tento operátor neznám")
|
||||
|
|
Loading…
Reference in a new issue