Feb-04-2019, 11:36 AM
Guys,
Back again, fiddling with an 'index out of range' thingy. To my (limited) knowledge this is how I would do it.
Your thoughts?
Back again, fiddling with an 'index out of range' thingy. To my (limited) knowledge this is how I would do it.
Your thoughts?
a = [1,2,3] b = [1] c = [1,4,5,6] d = [1,2,3] e = [a,b,c,d] index_needed = 2 output = [item[index_needed] for item in e if len(item) > index_needed] print(output) # outputs 3, 5, 3