Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #calculator
- def calculate(x , y , op):
- if op == '+' :
- z = x + y
- elif op == '-' :
- z = x - y
- elif op == '*' :
- z = x * y
- elif op == '//' :
- if y!=0:
- z = x // y
- else:
- print "division not possible"
- return z
- print calculate(9 , 9 , '//')
- print calculate(11 , 0 , '//')
Add Comment
Please, Sign In to add comment