Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python list comprehension exercises

# List 1 to 10
myList = [i + 1 for i in range(10)]
# List of even numbers from 0 to 100
myList = [i for i in range(100) if i % 2 == 0]
 
PREVIOUS NEXT
Tagged: #python #list #comprehension #exercises
ADD COMMENT
Topic
Name
6+7 =