Languages
[Edit]
EN

Python - iterate through string

0 points
Created by:
Dirask Community
6810

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

Python - string (popular problems)

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join