Flashcards
Python Flash Cards
Flashcards do conjunto (6)
- 1Lists and ArraysLists and Arrays are two ways to store multiple values in the same variable
For our purposes, Lists and Arrays are pretty much the same thing.
Python uses lists by default, most other programming languages use arrays. - 2Declearing listsLists are created using square brackets
A new list can be created with values separated by commas
An empty list can be created with empty brackets - 3Adding and Removing from a ListNew elements can be added to the end of a list using the append method.
Elements can be removed from a list using the remove method. - 4Reading from a ListSquare brackets can also be used to give the index of an element in a list.
The first element in the list has an index of 0, the next one has an index of 1 etc. - 5List MethodsFunctions built into objects like a list are called methods.
Methods are accessed by typing the name of the object, followed by a dot, then then the method name.
append and remove are two methods contained in the list object.
There are other useful methods.
Tip: You can type “help(list)” into the python console to view all the available methods - 6—
Informações
- Descrição
- FlashCards sobre Python Flash Cards, criado por ETHANDO 44 em 01-04-2019.
- Criado por
- ETHANDO 44
- Visualizações
- 0
- Avaliação