in Python by (32.2k points)
Explain Python List Comprehension

1 Answer

0 votes
by (32.2k points)

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

Related questions

0 votes
asked May 16, 2020 in Python by Robindeniel (20.8k points)
0 votes
...