Haider Imtiaz
Jun 18, 2021

I love your Question!

Okay so my solution is a list comphrehension and i discuss this in other article that list comphrehension is faster of indexing and loop rather then usual loops and indexing.

Here is itertool code

def from_iterable(iterables):

# chain.from_iterable(['ABC', 'DEF']) --> A B C D E F

for it in iterables:

for element in it:

yield element

So in my views List comphrehension always a faster approach for indexing.

Thank you

Please feel free to ask any other question

Haider Imtiaz
Haider Imtiaz

Written by Haider Imtiaz

Top Writer, Programmer, UI Designer, Thinker, and Fitness and Health expert ✌️ Become Medium Family Today😎 — https://codedev101.medium.com/membership

Responses (1)