Skip to content
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

ch03.rst2 error in section "Accessing Individual Characters" #243

Open
Kester00 opened this issue Nov 8, 2020 · 1 comment
Open

ch03.rst2 error in section "Accessing Individual Characters" #243

Kester00 opened this issue Nov 8, 2020 · 1 comment

Comments

@Kester00
Copy link

Kester00 commented Nov 8, 2020

There is an unexplained header found in subsection "Accessing Individual Characters", with the message below:
[sb] | explain this tuple unpacking somewhere?

image

Recommended fix:
Explain to readers that the tuples in the FreqDist are expressed in the form (char, count) and that the list comprehension [char for (char, count) in fdist.most_common()] extracts a list the alphabet characters and orders them in decreasing frequency.

@goodmami
Copy link

goodmami commented Nov 9, 2020

@Kester00 I'm not certain, but I think the request is more about explaining how unpacking works than about iteration over FreqDist. That is, how for (char, count) in fdist.most_common() assigns values to both char and count. This could be explained in Chapter 1, sections 2.3 (regarding assignment) and 4.3 (regarding for-loops). If this is the first time unpacking is used in the book, it also wouldn't be bad to explain as you suggest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants