Lab 2 Functions 1
- Use basic Python functions and operators
- Run code step-by-step in Thonny
- Define custom functions that use
- Define custom functions which are fruitful
- Use functions with
wavesynthaudio (your choice)
Table of Contents
- What's the difference between
There are a few differences:
returnvalue from a function can be used by other functions or code, or stored in a variable. Text printed using
- A function can use
- When you run a single line of code in the shell, both anything
that it prints using
- What is the first step when writing a custom function?
Before anything else, you should write your documentation string! This allows you to create a plan for what the function will do, as you describe it. Often, you will find that you either don't understand enough details to describe it, or you realize something about what your code needs to do as you describe it, both of which can save you a lot of time.