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


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


print(“The result is ”+result)


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


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