Write a python function to check whether a number is


Programming Assignments

1. Read Python Tutorial (https://docs.python.org/3/tutorial/index.html) sections 4.6 to 4.8.

2. Write a Python function that checks whether a passed string is palindrome or not. Note: A palindrome is word, phrase, or sequence that reads the same backward as forward, e.g., madam or nurses run.

3. Write a Python function to check whether a number is perfect or not. According to Wikipedia : In number theory, a perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the sum of its positive divisors excluding the number itself (also known as its aliquot sum). Equivalently, a perfect number is a number that is half the sum of all of its positive divisors (including itself).

Example : The first perfect number is 6, because 1, 2, and 3 are its proper positive divisors, and 1 + 2 + 3 = 6. Equivalently, the number 6 is equal to half the sum of all its positive divisors: ( 1 + 2 + 3 + 6 ) / 2 = 6. The next perfect number is 28 = 1 + 2 + 4 + 7 + 14. This is followed by the perfect numbers 496 and 8128.

Optional - Once you've finished with the assignment, go https://www.w3resource.com/python-exercises/python-functions-exercises.phpand do as many exercises as you can. Add the solutions to the exercises that you personally solved and a brief description of the process to arrive to the solution. If you had to look into the solution before you come up with the answer, DO NOT add it to the list of exercises resolved. Submit the list of programs resolved in a word document and upload it to Moodle.

Solution Preview :

Prepared by a verified Expert
Python Programming: Write a python function to check whether a number is
Reference No:- TGS01591400

Now Priced at $30 (50% Discount)

Recommended (98%)

Rated (4.3/5)