Knaph

Return values

The value a function hands back to the code that called it, with return, so its answer can be stored, added or passed on - unlike print, which only shows it on the screen.

Depth 1 · Foundation

You can make a function return its answer instead of printing it, use a call inside a bigger expression, plug functions into each other, and recognise the None that a function without return gives back.

Sign in to prove what you know with a short quiz, see how deep you've gone, and earn XP for it.

Sign in with Google

Depths of understanding

  1. 1

    Foundation

    You can make a function return its answer instead of printing it, use a call inside a bigger expression, plug functions into each other, and recognise the None that a function without return gives back.

Your path here

What's still between you and Return values, depth 1, in the order you can learn it.

  1. 1ProgramDepth 1 · Foundation · Program Basics
  2. 2ExpressionDepth 1 · Foundation · Program Basics
  3. 3Variables in codeDepth 1 · Foundation · Program Basics
  4. 4Program stateDepth 1 · Foundation · Program Basics
  5. 5Input and outputDepth 1 · Foundation · Program Basics
  6. 6Functions in codeDepth 1 · Foundation · Functions
  7. 7Return valuesDepth 1 · Foundation · Functions

Where it fits

Makes these deeper

Once you know Return values, come back to these — they'll mean more.