Calculator in python

def calculate(a, b, formula):
  if formula == '+':
    return a + b
  elif formula == '-':
    return a - b
  elif formula == '*':
    return a * b
  elif formula == '/':
    return a / b
  else:
    print('Just Leave!')
    return 'Closing program...'

print('Choose a number')
a = float(input())
print('Choose a second number')
b = float(input())
print('Do you want to * / - or + ?')
formula = input()
answer = calculate(a, b, formula)
print(answer)

Here is what the above code is Doing:
1. It’s asking the user to input a number.
2. It’s asking the user to input a second number.
3. It’s asking the user to input a formula.
4. It’s calculating the answer.
5. It’s printing the answer.