0

Why Can't I use INPUT in this program. While range works properly

https://code.sololearn.com/c9kckaji0Xor/?ref=app

19th Dec 2019, 3:16 PM
kuzantiv
kuzantiv - avatar
3 Antworten
+ 1
if int(i)%2 ==0
19th Dec 2019, 4:36 PM
rodwynnejones
rodwynnejones - avatar
+ 5
It is not clear what to input. You are talking about a series of numbers, but only one will be stored in var. You should decide if user should input some numbers with a defined separator, or if user should input one or two numbers so that you can build a range from them. Also keep in mind, that input always returns strings.
19th Dec 2019, 4:03 PM
Lothar
Lothar - avatar
+ 1
`input` function returns a string, you need to process the string to extract the values from it, and save it in an iterable (such as list) before you can work on it.
19th Dec 2019, 3:58 PM
Ipang