Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __operators = ('+','-', '/' , '//', '*', '**', '%')
- def calculator():
- x = eval(input())
- operator = 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)
- if __name__ == "__main__":
- calculator()
- """
- Sample input
- 567
- %
- 5
- Sample output
- 2
- """
Add Comment
Please, Sign In to add comment