generated from ubc-library-rc/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
in content/1.3_lists.md, line 116 (below for context)
mild_salsa = ['peppers', 'onions', 'cilantro', 'tomatoes']
hot_salsa = list(mild_salsa) # <-- makes a *copy* of the list
I would suggest the following as more appropriate:
hot_salsa = mild_salsa.copy()
Similarly, with "If all we want to do is copy a (simple) list, we can again use the list function", the list.copy() method is designed explicitly for this and is arguably more intuitive.
Metadata
Metadata
Assignees
Labels
No labels