Project 1 note: Yeah, I haven't finished grading it A function to make turtle graphs? Review/Expanded side note: What's a memory address?ยด - 64 bits on modern hardware - 32 bits in the past - C demo: print addresses - In C, we can say an address holds any type + For example, a function! - functions have addresses in the code block - printing out a function in Python While we've got a C program: Main functions Types in Python: Now with functions! - Memory addresses, and many types are the same Scope and blocks - global (you get to use these tomorrow) - local variables created in functions Functions can call other functions - or themselves... A couple function puzzles - Project 2 is function puzzles - Let's make some puzzles! Good function design: - Well-defined purpose - Parameters adapt the function to different situations Debatable function design: - Feel free to do these things if you have a good reason - Must be defined in a particular spot - Uses global variables - Interacts with the user Common Function Pitfalls: - Asking for user input in addition to function parameters + ONLY ok if that is the functions' purpose - Printing instead of returning values - Printing AND returning values - Trying to use local variables outside the function - Duplicating the function instead of using parameters Demos: Concrete balls Lookup table for volume - With tracking and noise functions