Functions: Fundamentals

In the Python Fundamentals for Data Science course, several commands — such as print(), sum(), len(), min(), and max() — were used. These statements are more often known as functions.

In this functions fundamentals mission, you will learn how to speed up your workflow using functions. You will also learn how to create your own functions, as well as combining and debugging custom functions. You will learn such concepts as parameters, keywords, and the three different kinds of arguments.

When writing a program, you could just keep rewriting the same code, but that would be quite tedious, and result in an unnecessarily large program. Functions are self-contained routines that perform a specific task that you can incorporate into your program. After declaring the function you are free to use the function anytime in an effort to save time and resources. A function displays these patterns: Takes an input, transforms the input, and gives back an output.

While learning about functions, you will create your own function including one to create a frequency table. For more information on frequency tables, you might want to check out our dictionary and frequency tables mission.

As you go through this mission, you’ll get to apply what you’ve learned from within your browser; there's no need to use your own machine to do the exercises. The Python environment inside of this course includes answer-checking to ensure you've fully mastered each concept before learning the next.


  • Learn what functions are and what they do.
  • Learn how to create your own functions.
  • Learn how to combine functions.
  • Learn how to debug functions.

Mission Outline

1. Functions
2. Built-in Functions
3. Creating Our Own Functions
4. The Structure of a Function
5. Parameters and Arguments
6. Extract Values From Any Column
7. Creating Frequency Tables
8. Writing a Single Function
9. Reusability and Multiple Parameters
10. Keyword and Positional Arguments
11. Combining Functions
12. Debugging Functions
13. Next steps
14. Takeaways


Course Info:


The median completion time for this course is 5.8 hours. View Details

This course includes 7 missions, 1 guided project, and 1 tutorial.  It is the first course in the Data Analyst in Python path and Data Scientist in Python path.


Take a Look Inside

(function(d) { d.addEventListener("DOMContentLoaded", function() { var pathname = d.location.pathname.replace(/^[/]|[/]$/g, "").replace("/", "-"); var tags = d.getElementsByTagName("iframe"); var type = pathname.startsWith("course") ? "?course=" : pathname.startsWith("path") ? "?path=" : null; if (type) { var i; for (i = 0; i < tags.length; i++) { if (tags[i].src.indexOf("signup#iframe") !== -1) { tags[i].src = tags[i].src.replace("#iframe", "") + type + pathname + "#iframe"; } } } }, false); })(document);