Question: Given a non-negative number num, return True if num is within 2 of a multiple of 10, False otherwise. Note: (a % b) is the
Given a non-negative number "num", return True if num is within 2 of a multiple of 10, False otherwise. Note: (a % b) is the remainder of dividing a by b, so (7 % 5) is 2. Write a main method to test all cases in clearly formatted output. Name this file NearTen.py
Determine Test Cases:
| n | Result (return value) |
def near_ten(num):
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
