daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import os
  2.  
  3. operators_list = ["+", "-", "*", "%", "/"]
  4. a = int(input("Įveskite skaičių: "))
  5. operator = raw_input("Įveskite operatorių: ")
  6. if operator not in operators_list:
  7.     print("Nežinomas veiksmas!\nEgzistuojantys veiksmai: (+) | (-) | (*) | (/) | (%)")
  8.     time.sleep(3)
  9.    
  10.  
  11. b = int(input("Įveskite antrą skaičių: "))
  12. if operator == "+":
  13.     sum = a + b
  14.     print("Suma yra: " + str(sum))
  15.    
  16. elif operator == "-":
  17.     sum = a - b
  18.     print("Suma yra: " + str(sum))
  19.    
  20. elif operator == "*":
  21.     sum = a * b
  22.     print("Suma yra: " + str(sum))
  23.    
  24. elif operator == "%":
  25.     sum = a % b
  26.     print("Suma yra: " + str(sum))
  27.    
  28. elif operator == "/":
  29.     sum = a / b
  30.     print("Suma yra: " + str(sum))
RAW Paste Data
Top