Trey Hunner Python 3.7-3.11*
Tags
When should you use Python's built-in list function to create a list?And when should use use square brackets ([...]) to create a new list instead?The list constructor is one of Python's built-in functions that is, strangely, frequently underused and overused.Let's take a look at when you should use the list constructor and when you shouldn't.
Tags
When should you use Python's built-in list function to create a list?And when should use use square brackets ([...]) to create a new list instead?The list constructor is one of Python's built-in functions that is, strangely, frequently underused and overused.Let's take a look at when you should use the list constructor and when you shouldn't.
[
add
]
[
|
|
...
]