Step: Functions: def and return

Functions: def and return

def name(params): defines a reusable function; return sends a value back to the caller (without it, a function returns None).

Why it matters: functions are how you name and reuse a piece of logic instead of copy-pasting it.

Example: def double(x): return x * 2 then double(5) is 10.

Your turn: define square(x) returning x * x, then print square(6).

Pitfall: a function with no return (or a bare return) gives back None — printing that result silently prints None instead of erroring.

Your code:
Expected output:
36
Step 12 of 18