I am supposed to create a program in which I am supposed to add numbers if they are string and concatenate numbers if they are integer. This is my code:
num1 = input("Enter an integer or string: ")
num2 = input("Enter an integer or string: ")
def stupid_addition(num1, num2):
if (num1, num2) == str:
result = int(num1 + num2)
else:
result = str(num1 + num2)
return result
stupid_addition(num1, num2)