Reverse function python? How to use?
kay.schluehr at gmx.net
Mon Oct 30 09:20:39 CET 2006
> Ok I'm really lost (I'm new to python) how to use the reverse function.
> I made a little program which basically the a, b, c, d, e which I have
> listed below and basically I want it th result to be printed reverse so
> instead doing "print e, d, c, b, a", I'd like to use the reverse
You can use extended slice operators
This function call should do what yo expect
print [e, d, c, b, a][::-1]
 Does anyone know where to find a comprehensible description of
enhanced slices in the Python docs besides an an aged "What's new?"
column? Or is it intended that newbies read this
More information about the Python-list