FAQ

On 9/2/2015 6:01 AM, Antoon Pardon wrote:
a = [1, 2, 3, 4, 5]
b = 1
b, a[b] = a[b], b
a
[1, 2, 1, 4, 5]
a = [1, 2, 3, 4, 5]
b = 1
a[b], b = b, a[b]
a
[1, 1, 3, 4, 5]

I think I understand how it gets these results
but I'm not really happy with them. I think python
should give the second result in both cases.

I do not want the choice taken away from me.


--
Terry Jan Reedy

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 10 of 20 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedSep 2, '15 at 10:01a
activeSep 4, '15 at 2:25p
posts20
users10
websitepython.org

People

Translate

site design / logo © 2017 Grokbase