Skip to content

Commit cd7e652

Browse files
Merge pull request #373 from saffy/patch-1
Update tutorial.md with a typo fix
2 parents 0c0cd35 + dfe2cb3 commit cd7e652

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

python/lesson3/tutorial.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ a dictionary for a phone book:
196196

197197
my_phone_book = {
198198
"Arya": "+4407485376242",
199-
"Breanne": "+3206785246863",
199+
"Brienne": "+3206785246863",
200200
"Cersei": "+14357535455",
201201
"Davos": "+244562726258"
202202
}
@@ -217,7 +217,7 @@ You can have *anything* in there:
217217
"a list": ["This", "is my", "list"],
218218
"another dictionary!": {
219219
"Arya": "+4407485376242",
220-
"Breanne": "+3206785246863",
220+
"Brienne": "+3206785246863",
221221
"Cersei": "+14357535455",
222222
"Davos": "+244562726258"
223223
}
@@ -247,7 +247,7 @@ doing this should hopefully feel intuitive by now:
247247

248248
Change a value for a key:
249249

250-
my_phone_book["Breanne"] = "+830685432195"
250+
my_phone_book["Brienne"] = "+830685432195"
251251

252252
Add a new key/value pair:
253253

@@ -270,18 +270,18 @@ manageable parts. Thankfully, Python has you covered with `.keys()`,
270270

271271
>>> my_phone_book = {
272272
"Arya": "+4407485376242",
273-
"Breanne": "+3206785246863",
273+
"Brienne": "+3206785246863",
274274
"Cersei": "+14357535455",
275275
"Davos": "+244562726258"
276276
}
277277
>>> my_phone_book.keys()
278-
dict_keys(['Davos', 'Cersei', 'Breanne', 'Arya'])
278+
dict_keys(['Davos', 'Cersei', 'Brienne', 'Arya'])
279279

280280
>>> my_phone_book.values()
281281
dict_values(['+3206785246863', '+14357535455', '+244562726258', '+4407485376242'])
282282

283283
>>> my_phone_book.items()
284-
dict_items([('Breanne', '+3206785246863'), ('Cersei', '+14357535455'), ('Davos', '+244562726258'), ('Arya', '+4407485376242')])
284+
dict_items([('Brienne', '+3206785246863'), ('Cersei', '+14357535455'), ('Davos', '+244562726258'), ('Arya', '+4407485376242')])
285285

286286
As you can see, `.keys()` and `.values()` do what you'd expect: they return the
287287
keys and values respectively. You may have noticed however that rather than a
@@ -301,7 +301,7 @@ your dictionary, but dumps it out as `dict_items` which is a sort of *tuple of
301301
tuples*. This allows you to reference your dictionary with list syntax:
302302

303303
>>> tuple(my_phone_book.items())[0]
304-
('Breanne', '+3206785246863')
304+
('Brienne', '+3206785246863')
305305

306306
>>> tuple(my_phone_book.items())[0][1]
307307
'+3206785246863'

0 commit comments

Comments
 (0)