Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- operators_list = ["+", "-", "*", "%", "/"]
- a = int(input("Įveskite skaičių: "))
- operator = raw_input("Įveskite operatorių: ")
- if operator not in operators_list:
- print("Nežinomas veiksmas!\nEgzistuojantys veiksmai: (+) | (-) | (*) | (/) | (%)")
- time.sleep(3)
- b = int(input("Įveskite antrą skaičių: "))
- if operator == "+":
- sum = a + b
- print("Suma yra: " + str(sum))
- elif operator == "-":
- sum = a - b
- print("Suma yra: " + str(sum))
- elif operator == "*":
- sum = a * b
- print("Suma yra: " + str(sum))
- elif operator == "%":
- sum = a % b
- print("Suma yra: " + str(sum))
- elif operator == "/":
- sum = a / b
- print("Suma yra: " + str(sum))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement