What use for reversed()?

fl rxjwg98 at gmail.com
Sun May 31 15:40:19 EDT 2015


Hi,

I have a string b='1234'. I run: br=reversed(b)

I hope that I can print out '4321' by:

for br in b

but it complains:
SyntaxError: invalid syntax


My questions:
1. What use for reversed(). I do not find an example on web.

2. If reversed() is wrong the my purpose, what method can do it? i.e. '4321'
out.


Thanks,



More information about the Python-list mailing list