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

Error in section 4.2 of Python Tutorial #41940

Closed
andrina mannequin opened this issue May 3, 2005 · 2 comments
Closed

Error in section 4.2 of Python Tutorial #41940

andrina mannequin opened this issue May 3, 2005 · 2 comments
Labels
docs Documentation in the Doc dir

Comments

@andrina
Copy link
Mannequin

andrina mannequin commented May 3, 2005

BPO 1194209
Nosy @rhettinger

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2005-05-04.13:34:29.000>
created_at = <Date 2005-05-03.04:02:15.000>
labels = ['invalid', 'docs']
title = 'Error in section 4.2 of Python Tutorial'
updated_at = <Date 2005-05-04.13:34:29.000>
user = 'https://bugs.python.org/andrina'

bugs.python.org fields:

activity = <Date 2005-05-04.13:34:29.000>
actor = 'rhettinger'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2005-05-03.04:02:15.000>
creator = 'andrina'
dependencies = []
files = []
hgrepos = []
issue_num = 1194209
keywords = []
message_count = 2.0
messages = ['25214', '25215']
nosy_count = 2.0
nosy_names = ['rhettinger', 'andrina']
pr_nums = []
priority = 'low'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1194209'
versions = []

@andrina
Copy link
Mannequin Author

andrina mannequin commented May 3, 2005

The example in section 4.2 of the on-line tutorial should read as
follows:

>>> # Measure some strings:
... a = ['cat', 'window', 'defenestrate']
>>> for x in a:
...     print x, len(a)
... 
cat 3
window 6
defenestrate 12

currently the print line has len(x)

@andrina andrina mannequin closed this as completed May 3, 2005
@andrina andrina mannequin added invalid docs Documentation in the Doc dir labels May 3, 2005
@andrina andrina mannequin closed this as completed May 3, 2005
@andrina andrina mannequin added invalid docs Documentation in the Doc dir labels May 3, 2005
@rhettinger
Copy link
Contributor

Logged In: YES
user_id=80475

Sorry, this is correct as is.

I'm not sure why you would think that len(a) is appropriate.
That would give the length of the list which is always
equal to three.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant