CurriculumPython Functions, Parameters and return for KidsParameters customise the ability
Python Function Parameters: Customising What a Function Does
Fireball, but bigger — the same function, a different result each time you call it.
Parameters customise the ability
def roar(): always does the exact same thing. Parameters let a call CHANGE what happens.
def greet(name): — name is a PARAMETER, a blank the caller fills in when they call it.
def greet(name):
print("Hello,", name)
greet("Ember")Output
Hello, EmberCall it again with a different value, and you get a different result — same function, no rewriting.
greet("Blaze")Output
Hello, BlazeThis is the whole idea of 'fireball, but bigger' — one ability, customised each time you cast it.
Check your understanding
def fireball(size): print("SIZE:", size). What does fireball(20) print, compared to fireball(5)?
def fireball(size):
print("SIZE:", size)Why: SIZE: 20. Each call passes its own value for the parameter — fireball(20) uses 20, completely independent of any earlier call.
What you'll practice
def greet(name): print("Hello,", name) — the ability now TAKES a name and uses it. Call greet("Ember") and greet("Blaze") — two different dragons, two different greetings.
More from this topic
Parameters customise the ability 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 →