[New-bugs-announce] [issue44199] code example index error in tutorial controlflow

HVoltBb report at bugs.python.org
Thu May 20 19:08:33 EDT 2021


New submission from HVoltBb <cannioc at gmail.com>:

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 at python
components: Documentation
messages: 394077
nosy: HVoltBb, docs at python
priority: normal
severity: normal
status: open
title: code example index error in tutorial controlflow
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44199>
_______________________________________


More information about the New-bugs-announce mailing list