How do i add a functional operation to a variable using input?

im new to python and im trying to make a calculator that allows you to choose the operation used. this is my code :

print ( “CALCULATOR” )

Num1 = int (input(“Enter your first number:”))

Num2 = int (input(“Enter your second number:”))

cal = input (“Enter the desired operation”)

print (Num1, cal, Num2)

does anyone know how to do this properly?

When you say “do this properly”, what exactly do you mean by “this”? What should happen when you run the code, and how is that different from the result you get?

instead of doing to equation it would say if i put for num1 = 3, num2 = 4, cal = / it would say 3 / 4 instead of doing to math

Might want to change them to float inputs so that you are not limited to only integers:

Num1 = float (input('Enter your first number:'))

Num2 = float (input('Enter your second number:'))

Also, when you prompt the user to enter the desired operation, are they supposed to spell out the operation? Best to provide them with a predefined menu option:

'*' - multiplication
'/' - division
'+' - addition
'-' - subtraction

You will also want to handle the special case when the user enters an invalid
operation (i.e., a random letter, alphanumeric character, etc.)

… just as an example. The upside is that your code can then easily interpret the desired operation.

Just some ideas.

If you want it to do the math, please see:

Look at the operator module. It has functions for each of the operations. Then

import operator as op
ops = {
    '+': op.add
uop = input(prompt)
value = ops[uop](arg1, arg2)

Thanks! its working now so your advice helped.