0 votes
in Python by
Explain Python List Comprehension

1 Answer

0 votes
by

List comprehensions are used for transforming one list into another list

Elements can be conditionally included in the new list and each element can be transformed as needed. It consists of an expression leading a for clause, enclosed in brackets. 

for ex: list = [i for i in range(1000)]

print list

...