Languages
[Edit]
EN

Python - iterate through string

0 points
Created by:
Haris65
536

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

Alternative titles

  1. Python - loop through string
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Python - string (popular problems)

Python - iterate through string
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