ch03: update from book draft
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# BEGIN DIALCODES
|
||||
# tag::DIALCODES[]
|
||||
# dial codes of the top 10 most populous countries
|
||||
DIAL_CODES = [
|
||||
(86, 'China'),
|
||||
@@ -20,11 +20,11 @@ print('d2:', d2.keys())
|
||||
d3 = dict(sorted(DIAL_CODES, key=lambda x:x[1])) # <3>
|
||||
print('d3:', d3.keys())
|
||||
assert d1 == d2 and d2 == d3 # <4>
|
||||
# END DIALCODES
|
||||
# end::DIALCODES[]
|
||||
"""
|
||||
# BEGIN DIALCODES_OUTPUT
|
||||
# tag::DIALCODES_OUTPUT[]
|
||||
d1: dict_keys([880, 1, 86, 55, 7, 234, 91, 92, 62, 81])
|
||||
d2: dict_keys([880, 1, 91, 86, 81, 55, 234, 7, 92, 62])
|
||||
d3: dict_keys([880, 81, 1, 86, 55, 7, 234, 91, 92, 62])
|
||||
# END DIALCODES_OUTPUT
|
||||
# end::DIALCODES_OUTPUT[]
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user