Advertisement
DrAungWinHtut

calc.py

May 7th, 2023
962
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. x = eval(input('enter x: '))
  2. y = eval(input('enter y: '))
  3. op = input('+,-,*,/ ?: ')
  4.  
  5. if(op == '+'):
  6.     ans = x + y
  7. if(op == '-'):
  8.     ans = x - y
  9. if(op == '*'):
  10.     ans = x * y
  11. if(op == '/'):
  12.     ans = x / y
  13.    
  14.  
  15. print(f'Answr is {ans}')
  16.  
  17.  
  18.  
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement