you can take advantage of itertools.zip_longest()
from itertools import zip_longest a = [1,2,3] b = [1] c = [1,4,5,6] d = [1,2,3] index_needed = 2 combined = list(zip_longest(a,b,c,d)) try: print(combined[index_needed]) except IndexError: print(f'There is no element with index {index_needed}')
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs