A.py - NUMDIV
Your task is to write a function is_divisible_by_7(num)
that checks if a given number num
is divisible by 7. Return True
if the number is divisible by 7, otherwise return False
.
Input:A single integer num
.
Output:Return True
if the number is divisible by 7, otherwise return False
.
Example 1:
Input: num = 14
Return: True
Explanation: 14 is divisible by 7.
Example 2:
Input: num = 20
Return: False
Explanation: 20 is not divisible by 7.
Example 3:
Input: num = 35
Return: True
Explanation: 35 is divisible by 7.
Example 4:
Input: num = 18
Return: False
Explanation: 18 is not divisible by 7.