Question: Write a Python program with at least the following functions. We want you to demonstrate your understanding of code reusability so you should write a

Write a Python program with at least the following functions. We want you to demonstrate your understanding of code reusability so you should write a few others -- we call these helper functions. For example, you might want to write a function that calculates and returns all the factors of a given number.
getFactors(x)- function that returns a list of factors of a given number x. Basically, finds the numbers between 1 and the given integer that divide the number evenly.
isPrime(x)- function that returns whether or not the given number x is prime. This function returns a boolean.
isComposite(x)- function that returns whether or not the given number x is composite. This function returns a boolean. We intend for you to reuse code from the prime number function here.
isPerfect(x)- function that returns whether or not the given number x is perfect. This function returns a boolean.
isAbundant(x)- function that returns whether or not the given number x is abundant. This function returns a boolean.
isTriangular(x)- function that returns whether or not a given number x is triangular. This function returns a boolean.
isNarcissistic(x)- function that returns whether or not a given number is Narcissistic. This function returns a boolean.

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!