Question: Write a function that takes two positive integers as input parameters,1 and 2. Assume 1 2. For any number, , where 1 2, if is

Write a function that takes two positive integers as input parameters,1 and 2. Assume 1 2. For any number, , where 1 2, if is divisible by each of its digits, print . For example, if 1 = 30 and 2 = 50, then your function should print 33, 36, 44, 48, because: 33 % 3 = 0 36 % 3 = 0 and 36 % 6 = 0 44 % 4 = 0 48 % 4 = 0 and 48 % 8 = 0

I currently have the following, but am struggling to incorporate to a function that uses a range of values inputted by the user:

import numpy as np

dgt = [] dgt1 = [] a = 33

def dvdgt(a): dgt = (str(a)) length = len(dgt) z = 0 while z < length: for x in dgt: y = int(x) dgt1.append(y) z += 1 chk = np.array(dgt1) if np.any(chk == 0): print("FAIL") break if np.all(a % chk == 0): print(a) else: print("FAIL")

dvdgt(a)

In addition to the function, please write some code to test the function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!