loop
← All sections

Module 4 · Functions, tuples, dictionaries, exceptions, and data processing

Creating multi-parameter functions

Everything you've learned about functions, put to work on real problems. Build functions that take several inputs — BMI, triangles, factorials, Fibonacci — and finish with recursion, a function that calls itself.

Begin lesson 1 →
  1. 1Evaluating the BMIYour first genuinely useful two-parameter function: weight and height in, BMI out.
  2. 2TrianglesThree sides in: decide whether they form a triangle, and measure its area.
  3. 3FactorialsMultiply a run of numbers together — the classic loop-and-accumulate function.
  4. 4Fibonacci numbersEach number is the sum of the two before it — built up with a loop.
  5. 5RecursionA function that calls itself: the call stack, the base case, and when to use it.