In Python, while operating with String, one can do multiple operations on it. Let’s see how to iterate over characters of a string in Python.
Example #1: Using simple iteration and
g e e k s f o r g e e k s G E E K S
Example #2: Using
G e e k s
Example #3: Iterate characters in reverse order
S K E E G s k e e g r o f s k e e g
Example #4: Iteration over particular set of element.
Perform iteration over string_name by passing particular string index values.
g e e k s f o r
- Iterate over a set in Python
- Iterate over a dictionary in Python
- Iterate over a list in Python
- Python | Iterate over multiple lists simultaneously
- Python | Ways to iterate tuple list of lists
- Python | Extract only characters from given string
- Check if both halves of the string have same set of characters in Python
- Concatenated string with uncommon characters in Python
- Python | Splitting string to list of characters
- Python | Removing unwanted characters from string
- Python | Return lowercase characters from given string
- Python | Split string into list of characters
- Python | Check if frequencies of all characters of a string are different
- Python | Ways to check string contain all same characters
- Python | Convert a list of characters into a string
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.