Python Quest

Track 4 · Lesson 10 of 11

Finding patterns: smallest, largest, first and all

Write the loops behind min, max, search, all and any yourself: track the best value so far, stop at the first match, and use flags.

About 40 minIntermediate4 exercises

You will be able to

  • Find the largest or smallest value and its position with a loop
  • Start a best-so-far variable safely, without guessing a starting number
  • Use a True/False flag to check whether all items, or any item, meet a condition
  • Track a run of consecutive values with a counter that resets

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.