Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- __operators = ('+','-', '/' , '//', '*', '**', '%')
- def calculator():
- x=input()
- operator=input()
- y=input()
- # 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