Functions In Class Code SamplesΒΆ

This first code box is provided for your convenience: you can put any code in here and try things out.

For each of the following code samples, answer these questions:

Multiple function calls in the same expression!

Local and global scope: BE CAREFUL.

return ends the execution, even if there’s more code

Without a return statement, the function returns None, when it runs out of code to execute (at the bottom of the function).

You have to do something with returned values, else they get discarded

Write a function definition that takes three numbers as inputs and returns the sum of all three

Next Section - Indefinite Iteration In Class Code Samples