A function in coding is like a recipe.
You love summer rolls. You know how to make your favorite kinds.
Every summer roll has:
• Meat
• Veggies
• A fantastic sauce
But the type of meat and veggies changes. So those are just parameters, they define the recipe generally, without locking in specifics.
def summer_roll(meat, veggies, sauce):
print(meat + veggies + sauce)
Then, depending on the kind you want, you fill it with different arguments:
summer_roll(“pork”, “lettuce”, “sweet chili sauce”)
Happy chowing.