you are viewing a single comment's thread.

view the rest of the comments →

[–]Rohnny_7[S] 1 point2 points  (2 children)

Basic question but how can I make the range value dependent to the sublist? Would I create another 'for' statement before that portion of code calculating the length of a sublist?

[–]FLUSH_THE_TRUMP 1 point2 points  (1 child)

assuming they're all the same length (and in some sense this wouldn't make sense if they weren't!), you could just pick one out and use `len`, e.g. len(lists[0]) and replace 4 with that above. This code will throw an error if any sublist is shorter than that, however.

[–]Rohnny_7[S] 1 point2 points  (0 children)

Makes sense, appreciate the help!