Explain why the following code won’t really add the two “numbers”:


#1

number1 = input(“Enter first number”)
number2 = input(“Enter second number”)
result = number1 + number2


#2

print(“The result is ”+result)


#3

why did you make so many topics? Its seriously a lot

assuming this code runs in python3, the problem is that number1 and number2 are of type string, adding strings together will cause a join, to truly add the numbers together, they would first need to be converted to integer


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.