CH3 - Introducing Lists Flashcards
What is a List?
A collection of items in a particular order.
What symbol represents a list in Python?
Square brackets [ ].
How to name a List?
Using plurals, for example: (Names)
How are elements separated in a List?
By using commas.
How is the position counted within a List?
Index.
Start of an Index?
0.
Last element of the index?
-1, or last positive index count.
Are methods supported in Lists?
Yes.
Are F-strings supported in Lists?
Yes.
Are List dynamic or static?
Dynamic.
How to replace elements in a list?
Index position, and value.
What is .append()?
A method in Python, That adds elements to the end of the list.
What is .insert()?
A method in Python, That inserts elements to any position of the list.
What is a simple way to add an element to a list?
By using the .append() method.
How to add an element to the end of a list?
By using the .append() method.