Skip to content

Minor clarifications for chapters 10 and 12 #464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions book3/10-tuples.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ key:
[('a', 10), ('b', 1), ('c', 22)]
~~~~

The new list is sorted in ascending alphabetical order by the key value.
The list of tuples is now sorted in ascending alphabetical order by the key.

Multiple assignment with dictionaries
-------------------------------------
Expand Down Expand Up @@ -403,7 +403,7 @@ To do this, we first make a list of tuples where each tuple is
list of `(key, value)` tuples, but this time we want to sort
by value, not key. Once we have constructed the list with the value-key
tuples, it is a simple matter to sort the list in reverse order and
print out the new, sorted list.
print it out.

~~~~ {.python}
>>> d = {'a':10, 'b':1, 'c':22}
Expand All @@ -420,7 +420,7 @@ print out the new, sorted list.
~~~~

By carefully constructing the list of tuples to have the value as the
first element of each tuple, we can sort the list of tuples and get our
first element of each tuple, we can sort the list of tuples and print our
dictionary contents sorted by value.

The most common words
Expand Down
3 changes: 2 additions & 1 deletion book3/12-network.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ send and receive the data according to the protocol.

However, since the protocol that we use most commonly is the HTTP web
protocol, Python has a special library specifically designed to support
the HTTP protocol for the retrieval of documents and data over the web.
the HTTP protocol for the retrieval of documents and data over the web,
`urllib`, which we'll cover shortly.

One of the requirements for using the HTTP protocol is the need to send
and receive data as bytes objects, instead of strings. In the preceding
Expand Down