This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Minor error in tutorial
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: doerwalter, konrads-
Priority: normal Keywords:

Created on 2005-04-14 19:32 by konrads-, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg25010 - (view) Author: Konrads Smelkovs (konrads-) Date: 2005-04-14 19:32
http://www.python.org/doc/current/tut/node11.html#SECTION00111100000000000000000
says:
sine_table = dict((x, sin(x*pi/180)) for x in range(0, 91))
should be:
sine_table = dict((x, sin(x*pi/180) for x in range(0, 91))
there is one too many brace after 180)
msg25011 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2005-04-14 20:01
Logged In: YES 
user_id=89016

The code is OK (this is a dictionary constructor consuming
generator expression which generates (key, value) pairs.
Wrapping the line should make it a little clearer:
sine_table = dict(
     (x, sin(x*pi/180))
     for x in range(0, 91)
)
History
Date User Action Args
2022-04-11 14:56:10adminsetgithub: 41857
2005-04-14 19:32:17konrads-create