
Python Lists
Presentation
•
Computers
•
11th Grade
•
Medium
Fabian Manning
Used 23+ times
FREE Resource
12 Slides • 7 Questions
2
Python List
Before introducing Python List, let us review
Python Variable
3
Python List: Variables
As in the case in math, Python uses variables to name unknown quantities
4
Python List: Variables
Mathematics | Python |
|---|---|
y = 2 | y = 2 |
y = boy | y = 'boy' |
x = girl | x = 'girl' |
In Python, the unknown quantities are called Data Types
Notice how the data type 'girl' and 'boy' are represented
5
Python: Variable vs List
Notice that each Variable is linked to one unknown?
That is y = 2, y = 'boy' or y = 'books'
In Python, lists are similar but, are used to store multiple items in a single variable.
Variable | List |
|---|---|
y = 2 | y = [2, 'boy', 'book'] |
y = 'boy' | |
y = 'book' | |
Notice:
List conveniently assign multiple items to a variable.
List is identified using [ ]
each item is separated using commas.
6
Python: List
You can view listings as chess with drawers.
Each item will be placed in one drawer.
Each drawer will be numbered, starting from 0. (this Python is called indexing.
0
1
2
3
4
7
Python: List
Example: The following is an example of a list...
y = [2, 'boy', 'book']
2 in slot 0
y =
boy in slot 1
book in slot 2
8
Multiple Choice
Is this the correct code for a list?
register = {"Sam", "Pheobe", Georgia", Richard"}
Yes
No
9
Multiple Choice
colours = [ ]
colours = ( )
colours = { }
colors = [ ]
10
Multiple Choice
What is used to separate elements in a list?
Bracket
Comma
Full Stop
Space
11
Multiple Choice
What brackets are used to create a list?
()
[]
12
Multiple Choice
What does the '#' allow you to do?
Repeat code
Comment on code
Print code
End code
13
Multiple Choice
Which of these is the correct code for creating a list of names?
nameList = John, Harry, Jesse, John, Harry, Harry
nameList = ("John", "Harry", "Jesse", "John", "Harry", "Harry")
nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
nameList = [John, Harry, Jesse, John, Harry, Harry]
14
Multiple Choice
This list contains items of what data type?
String
Boolean
Float
Integer
15
More About List
List items are...
ordered,
changeable, and
allow duplicate values.
16
More About List
List items are ordered,
This means that the items have a defined order, and that order will not change.
If you add new items to a list, the new items will be placed at the end of the list.
17
More About List
List items are ordered,
This means that each item occupies a specific position (having defined order), and that the order will not change.
If you add new items to a list, the new items will be placed at the end of the list.
18
More About List
List items are changeable,
This means that the items can be change by adding, and removing items after it has been created.
19
More About List
List items allow for duplicate values.
This means that lists can have items with the same value
thislist = ["apple", "banana", "cherry", "apple", "cherry"]
This is possible since each item in the list will occupy its own position (slot).
Show answer
Auto Play
Slide 1 / 19
SLIDE
Similar Resources on Wayground
17 questions
Guía de Diseño Web
Presentation
•
11th Grade
15 questions
Binary Search 2
Presentation
•
11th - 12th Grade
12 questions
Future Simple
Presentation
•
11th Grade
15 questions
Interactive Lesson
Presentation
•
11th Grade
14 questions
Funcion Lineal y Afin
Presentation
•
11th Grade
16 questions
Derechos de Autor - Clase 2
Presentation
•
11th Grade
13 questions
ACÚSTICA INTRODUCCIÓN
Presentation
•
10th - 11th Grade
13 questions
Inclined Planes
Presentation
•
10th - 11th Grade
Popular Resources on Wayground
16 questions
Grade 3 Simulation Assessment 2
Quiz
•
3rd Grade
19 questions
HCS Grade 5 Simulation Assessment_1 2526sy
Quiz
•
5th Grade
10 questions
Cinco de Mayo Trivia Questions
Interactive video
•
3rd - 5th Grade
17 questions
HCS Grade 4 Simulation Assessment_2 2526sy
Quiz
•
4th Grade
24 questions
HCS Grade 5 Simulation Assessment_2 2526sy
Quiz
•
5th Grade
13 questions
Cinco de mayo
Interactive video
•
6th - 8th Grade
20 questions
Math Review
Quiz
•
3rd Grade
30 questions
GVMS House Trivia 2026
Quiz
•
6th - 8th Grade