The example I show you is helped by means of a function which will allow me to pass as an argument the requested operation, the same is to annex the input but I think with this example I show you how to control in a basic way that The user chooses which operation he wants to perform:
# -*- coding: utf-8 -*-
def calculadora(option):
option1 = '+'
option2 = '-'
option3 = '*'
option4 = '/'
if(option == option1):
print(1 + 2)
elif(option == option2):
print(1 - 2)
elif(option == option3):
print(1 * 2)
elif(option == option4):
print(1 / 1)
else:
print('No reconozco nada')
calculadora('*')
Update
In the following code instead of passing the numbers by default I declare two variables that can take any value; which I pass in the form of arguments at the end inside the parentheses of the function
# -*- coding: utf-8 -*-
def calculadora(option, numero1, numero2):
option1 = '+'
option2 = '-'
option3 = '*'
option4 = '/'
if(option == option1):
print(numero1 + numero2)
elif(option == option2):
print(numero1 - numero2)
elif(option == option3):
print(numero1 * numero2)
elif(option == option4):
print(numero1 / numero2)
else:
print('No reconozco nada')
calculadora('*', 2, 30)
Now if for example you want to control both the operation and the two numbers that are entered to make the operation, I show you the following example that uses the input method to collect the 3 values (of course you can still do more on the validation side but serve as an example)
# -*- coding: utf-8 -*-
def calculadora():
option = input("Teclea la operacion: ")
numero1 = int(input("Teclea el numero1\n"))
numero2 = int(input("Teclea el numero2\n"))
option1 = '+'
option2 = '-'
option3 = '*'
option4 = '/'
if(option == option1):
print(numero1 + numero2)
elif(option == option2):
print(numero1 - numero2)
elif(option == option3):
print(numero1 * numero2)
elif(option == option4):
print(numero1 / numero2)
else:
print('No reconozco nada')
calculadora()