# construct a basic list using range() and list comprehensions # syntax # [ expression for item in list ] digits = [x for x in range(10)] print(digits)
# generate a list li = [ i+1 for i in [1,2,3] ] print(li) # [2, 3, 4]