Python Quest

Track 5 · Lesson 3 of 12

Return values

Send a result back to the caller with return, understand why that is different from print, and recognise None.

About 35 minBeginner4 exercises

You will be able to

  • Return a value from a function and use it in further calculations
  • Explain the difference between returning a value and printing it
  • Use return to leave a function early when the answer is already known
  • Recognise that a function without return gives back None, and spot the errors this causes

Included with a Formula Quest membership

It has 4 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.

View Formula Quest memberships

Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.