Stay With us
3 new comments

beginner
new

Help & Settings
About
Help
Tips

Sum method with input shows error in python

I have written a python code to tell the user number next to the input. Like if the user enters the number 5, the programme tells user that next number is 6. But it shows error.

a = input("Please enter a number: ")
sum = a + 1
print("Next number is: " + sum)

And error is

TypeError occurred Message=must be str, not int

Matt
75 Points

(1) Replies

Please login or register to Comment or Answer