num1 = input("Enter your first number: ")
operator = input("Enter +, *, +, or -")
num2 = input("Enter your second number: ")
if operator("+"):
print(num1 + num2)
Very new to Python and coding in general so please excuse it if the error is very simple.
operator('+')?operatoris a string. And for checking equality use==.if operator == '+'TypeErroris raised because OP is using astras function. Andnum1+num2works finestrsupports+but it is used for concatenation.