1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Paha777 [63]
3 years ago
10

Write a short program using Python that will:

Computers and Technology
1 answer:
Alexxx [7]3 years ago
6 0

Answer:

// program in Python to check perfect number

#function to find number is perfect or not

def is_Perfect_Number(n):

   #total variable

   tot = 1

   i = 2

   #sum of all divisor of number

   while i*i<=n:

       if n%i==0:

           tot = tot + i + n/i

       if tot == n and n != 1:

           return 1

       i = i+1  

   return 0

#read until user enter a perfect number

while True:

   #read integer

   num = int(input("Input an integer: "))

   #call the function

   if(is_Perfect_Number(num)):

       print(num,"is perfect number")

       #if perfect number break

       break

   else:

       print(num,"is not a perfect number")

       #ask again

   print("try again.")

Explanation:

Read number from user and then call the function is_Perfect_Number() with  parameter "num".This will find the sum of all divisor of number.If sum is  equal to number then it will return 1 else return 0.If the number is not  perfect then it will again ask to enter a number until user enter a perfect  number.

Output:

Input an integer: 24

24 is not a perfect number                                                                                                

try again.                                                                                                                

Input an integer: 28                                                                                                      

28 is perfect number

You might be interested in
What is a survey? plz hel​
Naya [18.7K]

Answer:

The act of seeing and recording information.

4 0
3 years ago
Read 2 more answers
A camera in manual mode means of the camera will make all the adjustments for the photographer
galben [10]
Manual mode is when the photographer makes all the adjustments themself
7 0
4 years ago
Which of the following could be true of two diffrent speicies that have competitieve realtionship in the same ecosytem?
chubhunter [2.5K]

they both an enemy that is the same but they also have a same niche so the have the same niche

6 0
3 years ago
One symptom of malware infection is that your antivirus software is disabled and cannot be re-enabled. Choose the answer. True F
Trava [24]

Answer:

False

Explanation:

Some malware software take advantage of the fact your computer has a virus and will try to advertise "anti-virus" software they made to hurt your computer even more.

4 0
3 years ago
Direction. List down 5 preventive maintenance tips in using tools and equipment.<br>1.​
PSYCHO15rus [73]

Answer:

Explanation:

preventive maintenance tips in using tools and equipment.

1. Inspect tools and equipment on a regular basis so as to avoid unexpected breakdown.

2. Clean tools and equipment immediately after use. It is important to wash or clean tools after using them in order to avoid clogging of dirts on them

3. Replace tools and equipment back to their respective storage place immediately after using them

4. Lubricate your tools and equipment to avoid rusting. Lubrication means to oil especially metal tools and equipments.

5. Always follow the instructions of use and maintenance of tools and equipments as stated by the manufacturer.

3 0
4 years ago
Other questions:
  • What is a motherboard?
    7·2 answers
  • Dead state is the name of the time delay in a cpu caused by differences between the speed of the cpu and ram.
    15·1 answer
  • How do computers use input and output to get and give the information that they need to solve problems?
    10·1 answer
  • "Find the sum of the squares of the integers from 1 to MySquare, where MySquare is input by the user. Be sure to check that the
    9·1 answer
  • Which is the fastest CPU and why?
    5·1 answer
  • Of the following potential benefits, which is LEAST likely to be provided by the upgraded system?
    12·1 answer
  • What adaptation Judy and her parents have that help them run from predators coming?​
    6·1 answer
  • How can ICT be a tool in connecting all stakeholders in your community?
    5·1 answer
  • John buy cheap stolen rims for his new truck?
    11·1 answer
  • Write a program that allows the user to input a total dollar amount for an online shopping order and computes and outputs the sh
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!