Skip to content
dreamcode
dreamcode
Back to map
Collection loops · Lesson 10 of 44
+15 XP on finish
PYTHON BASICS

Climbing collections

You can loop over lists, but did you know you can also loop over strings? A loop over a string goes character by character, processing one letter at a time.

How it reads
for char in word: assigns each letter of "neon" to char in sequence
char.upper() converts the current letter to uppercase
Cloud tip: Looping through characters or items is called iteration. It is one of the most common tasks in programming.
main.py
PYTHON
real Python, runs in your browser
CONSOLE
- run your code to see output -