Write a python function to check whether a number is perfect

Assignment Help Python Programming
Reference no: EM131207654

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.

Reference no: EM131207654

Questions Cloud

What issues addressed from counseling perspective for lisa : Determine what issues were addressed from a counseling perspective for Lisa. Describe the plan you will implement to begin working more effectively with Lisa's three children while in foster care.
State primary key for each table and all other attributes : Design the necessary database tables. - State the primary key for each table as well as all other necessary attributes.
How they each influenced you to become a global citizen : After reading the article by Reysen and Katzarska-Miller, explain why there has been disagreement between theorists about the definition of global citizenship and develop your own definition of global citizenship.
Estimate the cost formula for each cost incurred by baylor : Baylor Balloon Bouquets incurred the following monthly costs.- Using the formy = mx + b, estimate the cost formula for each cost incurred by Baylor Balloon Bouquets.
Write a python function to check whether a number is perfect : 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.
Apply principles of critical thinking to contemporary issues : Identify three out of five skills or competencies you have acquired through participation in general education courses that will help you strive to meet your academic and career goals.
Design and construction services for the mt crosby west bank : Your task is to write an ESSAY illustrating and explaining a methodology for the project from one case study - The mid-month progress update for the month will be in the form of a scheduled phone call, followed by an email summarising key discussion..
What is the target cost for the new game : If L"Oso desires a 60% markup on production costs, what is the target cost for the new game? -  Justin believes it will cost $24 per unit to produce the new game. What actions should he take next?
Find its clean and dirty values at the end of each quarter : A $1,000 seven-year 6% bond with semiannual coupons is redeemable for $1,065. It was originally purchased at issue for $970. It is sold after 45 months for $995. Find the accrued interest by the practical method and again by the theoretical method..

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd