Lesson 18 - List Comprehensions and List Assignments: Copying Lists
Lesson 18 - List Comprehensions and List Assignments: Copying Lists
List2 = [10,20,30,40]
Stingy OS
B = (list(A))
-
List 2 will contain a new list, but inner lists will be references not values
What do we do?
Append the lists
List comprehensions
Range() generates sequences of integers in fixed increments
List comprehension can be used to generate more varied sequences
S = [1, 4, 9]