diff --git a/native-datatypes.html b/native-datatypes.html index 88865f7..07a773b 100644 --- a/native-datatypes.html +++ b/native-datatypes.html @@ -453,14 +453,14 @@ IndexError: pop from empty list
Creating a dictionary is easy. The syntax is similar to sets [FIXME link fails because section is not written yet], but instead of values, you have key-value pairs. Once you have a dictionary, you can look up values by their key.
->>> a_dict = {'server':'db.diveintopython3.org', 'database':'mysql'} ①
+>>> a_dict = {'server': 'db.diveintopython3.org', 'database': 'mysql'} ①
>>> a_dict
{'server': 'db.diveintopython3.org', 'database': 'mysql'}
->>> a_dict['server'] ②
+>>> a_dict['server'] ②
'db.diveintopython3.org'
->>> a_dict['database'] ③
+>>> a_dict['database'] ③
'mysql'
->>> a_dict['db.diveintopython3.org'] ④
+>>> a_dict['db.diveintopython3.org'] ④
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'db.diveintopython3.org'