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
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
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