

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Functions
incomplete
2: Function Review
incomplete
3: Multiple Parameters
incomplete
4: Printing vs. Returning
incomplete
5: Where to Declare Functions
incomplete
6: Order of Functions
incomplete
7: Community
incomplete
8: Boots Interview
incomplete
9: Solutions
incomplete
10: None Return
incomplete
11: Multiple Return Values
incomplete
12: Parameters vs. Arguments
incomplete
13: Default Values
incomplete
14: Curse
incomplete
15: The Training Grounds
incomplete
16: Enchant and Attack
incomplete
17: Archmage
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Parameters are the names used for inputs when defining a function. Arguments are the values of the inputs supplied when a function is called.
To reiterate, arguments are the actual values that go into the function, such as 42.0, "the dark knight", or True. Parameters are the names we use in the function definition to refer to those values, which at the time of writing the function, can be whatever we like.
That said, this is all semantics, and frankly developers are really lazy with these definitions. You'll often hear the words "arguments" and "parameters" used interchangeably.
# a and b are parameters
def add(a, b):
return a + b
# 5 and 6 are arguments
sum = add(5, 6)