[issue44199] code example index error in tutorial controlflow

2021-05-21 Thread HVoltBb


HVoltBb  added the comment:

right. I just realized that the moment I hit the submit button, and I closed 
this issue right away. Thanks for clearing it up.

--

___
Python tracker 
<https://bugs.python.org/issue44199>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44199] code example index error in tutorial controlflow

2021-05-20 Thread HVoltBb


Change by HVoltBb :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue44199>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44199] code example index error in tutorial controlflow

2021-05-20 Thread HVoltBb


New submission from HVoltBb :

An index error in the code example given just above 
https://docs.python.org/3/tutorial/controlflow.html#documentation-strings

The code now is :
pairs = [(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four')]
pairs.sort(key=lambda pair: pair[1])
pairs

The "pair[1]" in the second line should be "pair[0]".

--
assignee: docs@python
components: Documentation
messages: 394077
nosy: HVoltBb, docs@python
priority: normal
severity: normal
status: open
title: code example index error in tutorial controlflow
type: behavior
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue44199>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com