pyPython Practice LabFrom first print to final round
TOPIC 11 OF 18

Comprehensions, Iteration, and Pythonic Data Work Python practice problems

Comprehensions, enumerate, zip, sorting keys, lambda, map/filter, and readable transformations.

10 exercises5+ conceptsBeginner → interview context
Start this topic
WHAT YOU WILL PRACTISE

Core concepts

Sort records with a lambdaSquare values with mapFilter passing scoresMultiply values with reduceCreate a countdown iterator
REUSABLE THINKING

Problem-solving patterns

  • lambda · sorting
  • map · lambda
  • filter · predicate
  • reduce · operator
  • iterator · StopIteration
PRACTICE OUTCOME

What this topic builds

Learn the idea once, use it across the exercises, and explain why your approach works.

ORDERED PRACTICE

All 10 problems in this topic

Work from top to bottom to build the concept gradually.

  1. #171
    Sort records with a lambda: Leaderboard

    Sort competitors by score, highest first.

    BeginnerPremium
  2. #172
    Sort records with a lambda: Tie by name

    Use the name as a predictable tie breaker.

    BeginnerPremium
  3. #173
    Square values with map: Positive sequence

    Square a short sequence of positive integers.

    IntermediatePremium
  4. #174
    Square values with map: Signed sequence

    Observe that squaring negative and zero values produces nonnegative results.

    IntermediatePremium
  5. #175
    Filter passing scores: Standard pass mark

    Keep all scores that meet a pass mark of 60.

    IntermediatePremium
  6. #176
    Filter passing scores: Everyone passes

    Handle a threshold met by every score.

    IntermediatePremium
  7. #177
    Multiply values with reduce: Package combinations

    Multiply option counts to find the number of package combinations.

    IntermediatePremium
  8. #178
    Multiply values with reduce: Zero factor

    Show that any zero factor makes the whole product zero.

    AdvancedPremium
  9. #179
    Create a countdown iterator: Custom countdown

    Iterate from three to zero using the iterator protocol.

    AdvancedPremium
  10. #180
    Create a countdown iterator: Iterator edge

    A countdown starting at zero still yields one element.

    AdvancedPremium