Lesson 5
Writing Reusable and Self-explanatory Programs
Chapter 5: Advanced function features
Quiz
Try these questions. Note that some of these are trick questions! 😈
For all questions, assume that you have the following function defined.
def calculate(x, y, z=1, negate=False):
result = (x + y) / z
if negate:
result = -result
return result
❮
❯