Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #VI LAB1/1 made by Fensa08
- # -*- coding: utf-8 -*-
- __operators = ('+', '-', '/', '//', '*', '**', '%')
- def calculator():
- x = eval(input())
- operator = eval(input())
- y = eval(input())
- # print(str(x) + operator + str(y))
- # your code here
- rezultat = 0
- if operator == "+":
- rezultat = x + y
- elif operator == '-':
- rezultat = x - y
- elif operator == '/':
- rezultat = x / y
- elif operator == '//':
- rezultat = x // y
- elif operator == '*':
- rezultat = x * y
- elif operator == '%':
- rezultat = x % y
- elif operator == '**':
- rezultat = x ** y
- else:
- print("GRESKA PRI VNES")
- print(rezultat)
- return rezultat
- if __name__ == "__main__":
- calculator()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement