0
why is it saying index out of range?
https://code.sololearn.com/cuZm73ygOMz8/#py i am trying to input a list of integers , find their divisors and judge if their sufficient.
5 Respostas
+ 3
Your data must be entered like 560 making a lst of [5, 6, 0], which doesn't crash.
+ 2
We need to know what input you are giving as that might be the problem.
0
for example if your array contains only 5 elements . when you try to access for example array [7] you will get index out of range .
0
how do i use a list comprehension to take in numbers of two or more digits?
0
lst=[int(x) for x in input().split()] will allow space between numbers so 15 65 340 0 will work all on one line.