Return Value

noun

say it: “ri-TURN VAL-yoo” /rɪˈtɝn ˈvæljuː/

The result a function hands back to the line that called it, using return, which can be stored in a variable or used straight away.

What is a return value?

A return value is the result a function hands back with return. You can store it in a variable or use it straight away.

def add_tip(bill):
    return bill * 1.2

total = add_tip(50)
print(total)  # 60.0

In a sentence

  • “A function with no return line has a return value of None.”
  • “The return value of add_tip(50) was 60.0, stored in total.”

Level: Apprentice · More Python terms at this level

Updated

In other subjects