Advertisement
biswasrohit20

pysol

Mar 11th, 2021
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. num1 = float(input("Please enter the first number: "))
  2. operation = int(input("Do you want to: \n 1) Add; 2) Subtract; 3) Multiply; 4) Divide: "))
  3. num2 = float(input("Please enter the final number: "))
  4.  
  5. if operation == 1:
  6. result = num1 + num2
  7. elif operation == 2:
  8. result = num1 - num2
  9. elif operation == 3:
  10. result = num1 * num2
  11. elif operation == 4:
  12. result = num1 / num2
  13.  
  14. print(f'The result is {result}')
  15.  
  16.  
  17.  
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement