#
Question Text#
Create a function called divisible_by_{{ params.vars.divisible_by }}
that has one input variable. You can assume that the input variable will always be a positive integer.
The function should return True
if the integer is divisible by {{ params.vars.divisible_by }}
, and False
otherwise. You can assume the function will only receive valid inputs. You are not required to include error handling.
Hint: Consider using the modulo operator (%
).
You should consider testing your function with at least two different numbers (test1
and test2
), and use assert
statements to confirm your function works correctly.
Answer Section#
pl-submission-panel#
Attribution#
Problem is licensed under the CC-BY-NC-SA 4.0 license.