Does input() enters a string? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Does input() enters a string?

when I entered a number and tried to print it's sum with other number error was displayed that str can't be concatenated with int.

18th Apr 2019, 5:37 PM
Shubham Singh
Shubham Singh - avatar
1 ответ
+ 3
Yes. Try i = int(input()) to turn the input into a number (or float(input()))
18th Apr 2019, 5:43 PM
Anna
Anna - avatar