Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- 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
- print(rezultat)
- return rezultat
- if __name__ == "__main__":
- calculator()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement