Founding Batch Offer · HLD · LLD · System Design at ₹799 until 30 Nov

ProgramsLogic building

Phase 3 - Level 3: Pattern Recursion

Print patterns using recursion.

10 programs · open one, then the next

Start with Print Line of N Stars Recursively
  1. 01Print Line of N Stars RecursivelyIntermediatePrint a line of n stars with a recursive function. Students trace printing before the next call and separate the terminating newline from repeated output.Open example →
  2. 02Print Square of Stars RecursivelyIntermediateDraw a square with recursive row and star helpers. Students trace a row index, a width counter, and two distinct stopping conditions without nested loops.Open example →
  3. 03Print Triangle (Top-Down) RecursivelyIntermediatePrint a growing triangle with recursive Python row helpers. Students trace output before the next row call and use a separate star function for each width.Open example →
  4. 04Print Triangle (Bottom-Up) RecursivelyIntermediatePrint decreasing star rows by delaying work until recursive calls return. Students trace a row helper and compare return order with the growing-triangle version.Open example →
  5. 05Number Patterns RecursivelyIntermediateGenerate increasing number rows with recursive helpers. Students separate a row-size function from a per-row number function and trace each helper's boundary.Open example →
  6. 06Print Reverse Triangle RecursivelyIntermediatePrint a right-aligned shrinking triangle with recursion. Students trace row output during return and calculate leading spaces independently of star counts.Open example →
  7. 07Multiplication Table RecursivelyIntermediatePrint a ten-row multiplication table through recursion. Students increment a multiplier argument and stop after ten while keeping the entered base unchanged.Open example →
  8. 08Increasing + Decreasing in One FunctionAdvancedPrint increasing then decreasing values with one recursive Python function. Students trace work before and after a call and avoid printing the peak twice.Open example →
  9. 09Sum Series with Steps RecursivelyAdvancedSum a descending stepped series recursively. Students trace a nonpositive stopping condition and see why the step must move the argument toward that condition.Open example →
  10. 10Character Patterns RecursivelyAdvancedBuild alphabet rows with two recursive helpers. Students trace row counts, per-row character positions, and the base cases that bound both recursive paths.Open example →