CurriculumPython Functions, Parameters and return for Kidsreturn hands a value back

return vs print() in Python: What's the Difference?

return doesn't print anything — deliver() is where a returned value actually goes.

Lesson 3 of 5PROAges 10+
See what PRO unlocks →

return hands a value back

Every function you've written so far printed its own output. return is different — it hands a value BACK, silently.

def compute_damage(): return 10 — calling compute_damage() does NOT print 10. It gives you 10 back, to use however you want.

def compute_damage():
    return 10

That's why print() and return can look confusingly similar, but aren't. print() shows something. return HANDS SOMETHING BACK for your code to use next.

deliver(value) is a new ability — it actually SENDS a value somewhere, using whatever a function returned.

deliver(compute_damage())

And calling a function is never a one-way trip — once it returns, your code keeps going with the very next line, same as always.

Check your understanding

def compute_damage(): return 10 — with NO print() anywhere inside it. Does calling compute_damage() show anything on its own?

def compute_damage():
    return 10

compute_damage()
  • No — return hands the value back silently, it doesn't display it
  • Yes — 10 prints automatically, since that's what got returned

Why: No — nothing shows. return only hands the value back; something else (print() or deliver()) has to actually show or use it.

deliver(compute_damage()), then print("DONE") on the next line. Does "DONE" still print?

deliver(compute_damage())
print("DONE")
  • Yes — the function call finishes and your code carries on to the next line
  • No — calling compute_damage() jumps away and "DONE" never runs

Why: Yes, DONE still prints. A function call finishes and returns, then your code carries on with the next line — exactly like any other instruction.

What you'll practice

def compute_damage(): return 10 — this ability hands back a number instead of printing anything itself. Deliver that returned value to the battle log with deliver(compute_damage()).

Unlock this lesson with PRO →

More from this topic

return hands a value back is one lesson inside Python Functions, Parameters and return for Kids — see the full lesson order and what the whole topic covers.

View the full topic →