Answer:
The following code is written in python programming language:
#define user defined function
def friendly(number, digits):
#set the while loop
while (number > 0):
#set the if condition
if (number % digits != 0):
#condition true return false
return False
digits -= 1
number //= 10
return True
'''Then you can copy code from the question and paste after this code '''
Output:
friendly(42325,5) is True
friendly(82736451,8) is False
friendly(18,2) is True
friendly(497,3) is False
Step-by-step explanation:
Here, we define a user defined function "friendly()" and pass two argument in its parameter "number", "digits".
Then, we set the while loop and pass the condition "number > 0".
Then, we set the if loop and pass the condition "number % digits != 0" then, if the condition is true then it return false.
And you can copy code from the question and paste after the following code.