Below are two MCQs relating to the Creating Functions in python from this lesson.
(The following questions assume python version 2.7 or below)
def compute_slope(y=0, x, b=0):
"""calculate the slope, m, in the equation y = mx + b"""
m = (y - b) / x
return m
Correct answer: E
The example of debugging a function is a lesson in integer math. This MCQ tests this understanding further. Each of the distractors is meant to test understanding of: A: modulo (or remainder) B, C: how rounding occurs in integer division (floor) C: how integer division can be clearly (intentionally) stated