0

Why is not work?

s = input() print(s+1)

30th Jul 2019, 9:13 AM
_ BROMBIN_
_ BROMBIN_ - avatar
3 Answers
+ 7
Type s is str, you need print(int(s) +1)
30th Jul 2019, 9:21 AM
Mikhail Gorchanyuk
Mikhail Gorchanyuk - avatar
+ 4
Because input() returns a string. When you add a string and an integer it raises an error. Try int(input())
30th Jul 2019, 9:21 AM
Trigger
Trigger - avatar
0
thanks
30th Jul 2019, 9:34 AM
_ BROMBIN_
_ BROMBIN_ - avatar