Chrome Extension

Loop through string characters in Python

You can simply apply python for loop on a string that will gives you the character of the string in each iteration.
for char in "orange":
    print(char)
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool
Output
o
r
a
n
g
e

Here we are applying a for loop on the string 'orange' that will print each character of the string as output.

Was this helpful?
0 Comments