Functions

Define Your First Function

① Learn

A function is a reusable block of code with a name. def creates the function so you can call it later.

② Implement — write it, run it, submit
Goal

Define a function `double` that returns the input number multiplied by `2`.

Output
Hints
  • Stuck? Reveal a hint.
Free Tools & Calculators