EN
Python - iterate through string
0
points
In this article, we would like to show you how to iterate through a string in Python.
Quick solution:
for x in "dirask":
print(x)
Practical example
In this example, we use for loop to iterate through the "dirask" string and print each character.
for x in "dirask":
print(x)
Output:
d
i
r
a
s
k