string - Functional programming in Python
Keyboard shortcuts
Press β or β to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
string
We can iterate over the βelementsβ of a string that are the characters. We can also print the whole string.
name = "Learn π Python"
for cr in name:
print(cr)
print(name)
Output:
L
e
a
r
n
π
P
y
t
h
o
n
Learn π Python