In this mission, you will improve on what you learned in the functions fundamentals mission and learn more about functions to write better code while avoiding common pitfalls. You will also learn more function concepts, such as default arguments, scope, and more.
You will learn how to use documentation, exploring the official Python documentation to discover new tricks you can implement in your code. Becoming familiar with the documentation and knowing how to read it is important for a data scientist; you will be learning constantly and exploring unfamiliar territory when writing code.
In the earlier missions of this course, several commands — such as
max() — were used. In the functions fundamentals mission, you found out these commands are known as functions.
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. Moreover, 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.
As you go through this mission, you will be given an opportunity to practice your skills with our interactive code editor with built-in answer checking to ensure you have completely mastered each concept before moving on to the next.
- Learn what default arguements are.
- Learn how to use multiple return statements.
- Learn how to use multiple variables.
- Learn how mutable and immutable data types behave.
- Learn how to use documentation.
- Interfering with the Built-in Functions
- Variable Names and Built-in Functions
- Default Arguments
- The Official Python Documentation
- Multiple Return Statements
- Returning Multiple Variables
- More About Tuples
- Functions — Code Running Quirks
- Scopes — Global and Local
- Scopes — Searching Order
- Next Steps