Functions
Learn about code reuse with Python functions. Apply that knowledge to create functions for famous physics formulas.
StartKey Concepts
Review core concepts you need to learn to master this subject
Function Parameters
Multiple Parameters
Functions
Function Indentation
Calling Functions
Function Arguments
Function Keyword Arguments
Returning Multiple Values
Function Parameters
Function Parameters
def write_a_book(character, setting, special_skill):
print(character + " is in " +
setting + " practicing her " +
special_skill)
Sometimes functions require input to provide data for their code. This input is defined using parameters.
Parameters are variables that are defined in the function definition. They are assigned the values which were passed as arguments when the function was called, elsewhere in the code.
For example, the function definition defines parameters for a character, a setting, and a skill, which are used as inputs to write the first sentence of a book.
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory