Python Quest

Track 4 · Lesson 3 of 11

Looping over text and lists

Use a for loop to visit every character of a string and every item of a simple list, without counting positions yourself.

About 30 minBeginner4 exercises

You will be able to

  • Loop over the characters of a string
  • Write a simple list literal and loop over its items
  • Combine a loop with an if statement to act on some items only
  • Choose between looping over range() and looping over the data directly

Included with a Formula Quest membership

It has 4 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.

View Formula Quest memberships

Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.