about sort and dictionary

bonono at gmail.com bonono at gmail.com
Tue Nov 22 11:04:33 CET 2005


Fredrik Lundh wrote:
> so what would an entry-level Python programmer expect from this
> piece of code?
>
>     for item in a.reverse():
>         print item
>     for item in a.reverse():
>         print item
>
I would expect it to first print a in reverse then a as it was.

a=[1,2,3]

I expect it to print

3
2
1
1
2
3

As for your other comment, I don't even understand them.




More information about the Python-list mailing list