Parameters
On to STEP 2. This is where functions stop being cute little tricks and start becoming
customizable, flexible, game-powered machines.
Letβs unleash the chaos.
Alright coder β in Step 1, your functions were like:
βTell me what to do, boss, and Iβll do it exactly the same way every time.β
But now?
Now your functions get parameters, which means they can take input and behave differently depending on what you give them.
Itβs like upgrading your function from a basic toaster to a toaster with settings:
- light
- medium
- βburn it like my hopes and dreamsβ
Parameters = customization.
1. Whatβs a Parameter?
A parameter is a variable inside a function that waits for information.
def greet(name):
print("Hello, " + name + "!")
Now the function can greet ANYONE.
greet("Ava")
greet("Mark")
greet("Sir Fluffington the Third")
Your function is now socially adaptable.
2. Why Parameters Matter for Games
Parameters let you build:
- attack systems
- healing systems
- damage calculators
- item pickups
- dialogue lines
- movement commands
Basically, every cool game mechanic ever.
Without parameters, your game is stuck saying the same thing over and over like a broken NPC.
3. Example: Attack Function With Damage
def attack(damage):
print("You strike the enemy for " + str(damage) + " damage!")
Call it like this:
attack(5)
attack(12)
attack(999)
Your hero now hits like a customizable wrecking ball.
4. Multiple Parameters = Maximum Chaos
def heal(player, amount):
print(player + " heals for " + str(amount) + " HP!")
Call it:
heal("Ava", 10)
heal("Liam", 25)
Your game now handles healing like a fantasy hospital.
Practice (Your Turn!)
Mini-Challenge
Create a function called pickup(item) that prints:
You picked up a <item>!
Your game now reacts to items like a happy loot goblin.
You now understand:
- what parameters are
- how to pass information into functions
- how to customize behavior
- how to build dynamic game systems
- how to make your functions 10x more powerful
Your code officially has input-powered superpowers.
Ready for Step 3, where we unlock return values β the feature that lets functions send information back like magical messengers?

