So I have to write a program that takes two arguments, an integer 'num', and an integer 'limit'. It then has to return the list of divisors of num that are less than or equal. To break it down more, A divisor of 'num' is a number X between 1 and 'num' such that the remainder of dividing 'num' by X is 0. If any argument is not an integer, the function is supposed to return None.
here is an example of what I mean:
.....divisors("hello!", 5) should return None, because "hello" is a string
.....divisors("23", 5) should return None, because "23" is a string
......divisors(15, 12.34) should return None, because 12.34 is a float
......divisors(1, 5) should return [1]
......divisors(12, 5) should return [1, 2, 3, 4]
def divisors(num, limit):
if num and limit not type(int):
return None
else:
# I don't know what else to put here to make it divide and return the correct values....