Question: problem a Create a function that checks if a number a is divisible by another number b. The function should take the two numbers as
problem a
Create a function that checks if a number a is divisible by another number b. The function should take the two numbers as parameters.The function should return True if a is divisible by b, False otherwise.(Hint: Use the modulo (%) operator). (note: I have the answer to this problem (problem a), but not b and c.
problem b
A perfect number is a number where the sum of the factors is equal to the number itself.Count by 1 but do not count by the number itself.6 is a perfect number because 6 = 1 * 2 * 3 = 1 + 2 + 3. 10 is not a perfect number since 10 = 1 * 2 * 5, which is different from 1 + 2 + 5 = 8. Create a function thattakes in a number as a parameter, checks if the number is perfect and returns the result as a boolean value.One can find the factors in a number with a for-loop that starts at 2 and ends at or just after the number / 2 and that uses the function from problem f).For each number that is a factor, the function from problem f) will return true.
problem c
Write one or more scripts that use the functions from problem f) and g)
these problems have to be solve in python programming language. thanks.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
