for loop for string in python code example
Example 1: how to loop through string in python
for i in "Hello":
print(i)
Example 2: python for loop
for i in range(3):
print(i)
#prints: 0,1,2
Example 3: iterate through characters in a string python
for c in "string":
#do something with c