Skip to content

Commit 0bfc003

Browse files
authored
Merge pull request #363 from ecmendenhall/python-lesson-3-list-examples
Python lesson 3 list examples
2 parents 8aa1d53 + c307a2a commit 0bfc003

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

python/lesson3/tutorial.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,22 @@ for a more complete reference:
7373

7474
>>> places_to_visit
7575
['Mexico', 'Portugal', 'Kenya', 'Nepal', 'New Zealand']
76-
76+
77+
>>> places_to_visit = ['Mexico', 'Portugal', 'Kenya', 'Nepal', 'New Zealand']
7778
>>> places_to_visit[1] = "Peru"
7879
>>> places_to_visit
7980
['Mexico', 'Peru', 'Kenya', 'Nepal', 'New Zealand']
8081

82+
>>> places_to_visit = ['Mexico', 'Portugal', 'Kenya', 'Nepal', 'New Zealand']
8183
>>> places_to_visit.pop()
82-
'Peru'
84+
'New Zealand'
8385
>>> places_to_visit
84-
['Mexico', 'Portugal', 'Kenya', 'Nepal', 'New Zealand']
86+
['Mexico', 'Portugal', 'Kenya', 'Nepal']
8587

86-
>>> places_to_visit.append("Columbia")
88+
>>> places_to_visit = ['Mexico', 'Portugal', 'Kenya', 'Nepal', 'New Zealand']
89+
>>> places_to_visit.append("Colombia")
8790
>>> places_to_visit
88-
['Mexico', 'Portugal', 'Kenya', 'Nepal', 'New Zealand', 'Columbia']
91+
['Mexico', 'Portugal', 'Kenya', 'Nepal', 'New Zealand', 'Colombia']
8992

9093
Try some of these out yourself:
9194

0 commit comments

Comments
 (0)