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

Loops and Repeated Work Python lessons

for, while, counters, accumulators, ranges, and stopping conditions.

10 exercises8+ conceptsBeginner → interview context
Start this topic
WHAT YOU WILL LEARN

Core concepts

Sum the first n integersCalculate a factorialPrint a multiplication tableCount digits in an integerReverse an integerCheck a numeric palindromeTest primalityList primes up to n
REUSABLE THINKING

Problem-solving patterns

  • for loop · accumulator
  • factorial · loop
  • range · formatting
  • while loop · digits
  • while loop · modulo
LESSON OUTCOME

What this topic builds

Learn the idea once, trace it through two verified cases, then explain why your approach works.

ORDERED LESSONS

All 10 lessons in this topic

Work from top to bottom to build each concept gradually.

  1. #021
    Sum the first n integers

    Add counters numbered 1 through 10 for a simple progress total.

    StarterPremium
  2. #022
    Calculate a factorial

    Find the number of arrangements of six distinct display items.

    StarterPremium
  3. #023
    Print a multiplication table

    Generate the standard ten-line multiplication table for 7.

    BeginnerPremium
  4. #024
    Count digits in an integer

    Count how many digits appear in an invoice identifier.

    BeginnerPremium
  5. #025
    Reverse an integer

    Reverse the digits of a numeric access code.

    BeginnerPremium
  6. #026
    Check a numeric palindrome

    Check whether a five-digit gate code reads the same backward.

    BeginnerPremium
  7. #027
    Test primality

    Check whether 29 can be used as a prime-sized hash table example.

    IntermediatePremium
  8. #028
    List primes up to n

    List all prime numbers that do not exceed 20.

    IntermediatePremium
  9. #029
    Generate Fibonacci terms

    Generate ten Fibonacci terms for a learning dashboard.

    IntermediatePremium
  10. #030
    Find GCD and LCM

    Find when 18-day and 24-day maintenance cycles align, along with their GCD.

    AdvancedPremium