Try the reversed builtin:
for c in reversed(string):
print c
The reversed() call will make an iterator rather than copying the entire string.
PEP 322 details the motivation for reversed() and its advantages over other approaches.
More Related Contents:
- String concatenation without ‘+’ operator
- When is not a good time to use python generators?
- Iterate over the lines of a string
- Reverse a string without using reversed() or [::-1]?
- How to test if a string contains one of the substrings in a list, in pandas?
- TypeError: ‘str’ does not support the buffer interface
- How to check for palindrome using Python logic
- removing emojis from a string in Python
- How do I split a multi-line string into multiple lines?
- How do I iterate through two lists in parallel?
- How do I convert all strings in a list of lists to integers?
- TypeError: cannot concatenate ‘str’ and ‘int’ objects [duplicate]
- NLTK-based text processing with pandas
- Finding occurrences of a word in a string in python 3
- Python 3.1.1 string to hex
- Why can’t I end a raw string with a backslash? [duplicate]
- Why empty string is on every string? [duplicate]
- cleanest way to call one function on a list of items
- Is there a native templating system for plain text files in Python?
- Modifying a list while iterating when programming with python [duplicate]
- One-liner to check whether an iterator yields at least one element?
- Confused with python lists: are they or are they not iterators? [duplicate]
- Split a string into 2 in Python
- How can I split by 1 or more occurrences of a delimiter in Python?
- How to make Python format floats with certain amount of significant digits?
- Extending builtin classes in python
- Filtering pandas dataframe rows by contains str
- Find text position in PDF file
- python replace backslashes to slashes
- Swapping uppercase and lowercase in a string [duplicate]