Skip to content

Minor change suggestion #1

@plesubc

Description

@plesubc

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions