Guest User

Untitled

a guest
Apr 12th, 2021
62
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print('Please select an operation (+, /, *, -)')
  2. users_input = input()
  3. number1 = float(input('Please enter the first number !'))
  4. number2 = float(input('Please enter the second number !'))
  5. try:
  6.     if users_input == '+':
  7.         print(number1, '+', number2, '=', number1 + number2)
  8.     elif users_input == '/':
  9.         print(number1, '/', number2, '=', number1 / number2)
  10.     elif users_input == '-':
  11.         print(number1, '-', number2, '=', number1 - number2)
  12.     elif users_input == '*':
  13.         print(number1, '8', number2, '=', number1 * number2)
  14.     else:
  15.         raise ValueError
  16. except ValueError:
  17.     print('Bad input!')
  18.  
RAW Paste Data