Question 1
Write a function is_three_digit_and_digit_sum_divisible_by_k(n, k) that returns True if n is a three-digit number (from 100 to 999) and the sum of its digits is divisible by k. In every other case it returns False.
NOTE: This is a function type question, you don't have to take input or print the output, just have to complete the required function definition.
Example
is_three_digit_and_digit_sum_divisible_by_k(145, 5) -> True
is_three_digit_and_digit_sum_divisible_by_k(123, 5) -> False
Your task
Implement this function:
def is_three_digit_and_digit_sum_divisible_by_k(n: int, k: int) -> bool:
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: n, k.
Example
Input
145
5
Output
True