Skip to content
KnowledgeCity

Defining Functions

Learn key elements of creating and defining custom functions in Python and how to maximize reuse
Preview the first lesson free — get full access to all 4 lessons.
Course: On-Demand
Beginner Provider John Crabtree  4 Lessons ·  28m  in Arabic, German, English, Spanish, French, Portuguese, Chinese 

Course Description

These lessons begin with a discussion of why functions are important and how to create your own custom function. The use of parameters and arguments are presented along with details regarding Python's treatment of argument passing. Finally, returning values from functions is presented along with a discussion of the importance of code modularity.

LEARNING OBJECTIVES:

What You'll Learn

  • Understand why functions are important in programming
  • Define custom functions using the def keyword
  • Write and define parameters for your functions
  • Pass arguments to parameters by assignment in Python
  • Return values from functions
  • Maximize function reuse and code modularity

Key Takeaways

  • Functions are an important building block for writing useful programs.
  • Custom functions are created using Python's def keyword.
  • Parameters and arguments allow data to be supplied to functions, and Python passes arguments to parameters by assignment.
  • Functions can return values back to the code that calls them.
  • Writing functions supports code modularity and maximizes reuse.

Frequently Asked Questions

What does this course cover?

It covers why functions are important, how to create custom functions with the def keyword, the use of parameters and arguments, Python's treatment of argument passing, and returning values from functions.

What skills will I gain from this course?

You will gain skills in custom functions, function modules, function points, programming concepts, user defined functions, and utility functions.

What lessons are included in this course?

The course includes four lessons: Function Definition, Function Parameters, Function Arguments and Pass-By Assignment, and Returning Values from Functions.

How does Python pass arguments to functions?

The course explains that Python passes arguments to parameters by assignment.

Why does this course emphasize functions?

It discusses the importance of functions in programming and how writing reusable functions supports code modularity.