You've defined
multiplication_or_division
to take two parameters, but when you call it:
multiplication_or_division(int(num_1), int(num_2))
you try to pass it variables which don't exist -
num_1
and
num_2
are declared as the parameters to the
multiplication_or_division
function and only exists inside that function - you are supposed to pass them into the function so it can process them:
def multiplication_or_division(num_1, num_2):
if num_1 * num_2 <= 1000:
print(num_1 * num_2)
else:
print(num_1 + num_2)
num_1 = input("first number: ")
num_2 = input("second number: ")
multiplication_or_division(int(num_1), int(num_2))
Or not pass them as parameters:
def multiplication_or_division():
num_1 = int(input("first number: "))
num_2 = int(input("second number: "))
if num_1 * num_2 <= 1000:
print(num_1 * num_2)
else:
print(num_1 + num_2)
multiplication_or_division()