Square area visualizer
n=?
n²
square(?) = ?
1def square(n):
2return n * n
Write a function, call it, and visualise the square area it produces. A function is a machine: put n in, get n² out.
One parameter, one return.
You create a function that takes a number and returns that number multiplied by itself.
Used in area formulas, physics equations, score metrics, and many math-heavy program calculations.
def square(n): declares a function named square that takes one argument.return n * n sends the computed value back to the caller.A flooring app calls square(side) to get room area in sq ft. The same function powers dozens of room cards — one definition, many calls.