Section 6: Functions
6.1 Function Basics
Get introduced to functions.
·
Know what a function is and why you would want
to use one
·
Learn about condensed code, which is code that
is clearer, reusable, and with fewer bugs
·
Take a look at a small example function to
calculate the area of a circle for instance
Click Here to Download
6.2 Parameters and Arguments
Get introduced to the idea of parameters and arguments.
·
Explore the difference between arguments and
parameters and then go on to learning examples
·
Create a function that uses default parameter
·
Explain what a variadic function is and how to
make one
Click Here to Download
6.3 Return versus Void Functions
This video aims to introduce the functions that return a
value and those that do not.
·
Explanation with slides of what a void function
is and what a function that returns a value looks like
·
Learn when to use one instead of the other and
compare and contrast with functions that are built into Python
6.4 Working with Examples
Expose the writing functions.
·
The first example will be a function that can
reverse a string
·
The next function will be a void function that
checks whether a number is a palindrome
·
Take a look at additional examples
Click Here to Download
6.5 Advanced Examples
Learn to create slightly more complex functions.
·
Implement a generalized shift cipher
·
Code the encryption function
·
Code the decryption function
Click Here to Download
6.6 Recursion
Introduce function recursion.
·
Explore the basics of recursion (a function that
calls itself and the base case)
·
Take a look at the advantages of using recursion
·
Give simple examples including doubling a number
recursively and computing an exponential recursively
Click Here to Download
6.7 Recursion Examples
Get introduced how to write recursive functions.
·
See a demo of how to sum up the digits of a
number recursively
·
Make another recursive function to count the
number of vowels in a string
Click Here to Download
0 Comments