Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Nested list comprehensions

# Nested list comprehension  
nested_list = [[_ + __ for _ in range(5)] for __ in range(3)]  
   
print(nested_list)

[[0, 1, 2, 3, 4], [1, 2, 3, 4, 5], [2, 3, 4, 5, 6]]
Source by www.javatpoint.com #
 
PREVIOUS NEXT
Tagged: #Nested #list #comprehensions
ADD COMMENT
Topic
Name
9+6 =