Module 2 · Basics · Lesson 3 of 9
Function arguments
We've been calling the values inside the parentheses arguments — let's make that precise. An argument is a single piece of data you hand to a function for it to work with. It sits inside the function's parentheses.
print("Hello")↑ the argument — the data you give itruns ↓
So in print("Hello"), the text "Hello" is the argument — the thing you're asking print to show. An argument doesn't have to be text, either: it can be a number, or even the result of a calculation. Whatever you pass in, print shows it.
Every function decides what its arguments mean and what to do with them. print's job is simple — display them — but the idea runs through all of Python: you call a function and feed it the data it needs through its arguments. Now that you can give a function its data, the bigger question is how to stack up many instructions into a whole program — and Python has firm rules about that.