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
wlad13 [49]
3 years ago
12

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). Write a Python3 program to check if a user-entered number is a perfect number or not. Use exception handling to handle invalid inputs.
Computers and Technology
1 answer:
rusak2 [61]3 years ago
8 0

Answer:

Explanation:

def the_perfect(n):

  try: #exception handling if n is a negative number

       n > 0

   except: #return -1 if the error is reached

       return -1

  else:

        total = 0

        for i in range(1, n): #for loop from 1 to the target number

           if n % i == 0:

               total += i

   return total == n  #should return true if number is perfect number

print(perfect_number(8))

You might be interested in
Need help ASAP.<br> I am so lost.
Savatey [412]

Answer: china

Explanation:

6 0
3 years ago
What is multimedia computer system​
ivann1987 [24]

A Multimedia can be defined as any application that combines text with graphics, animation, audio, video, and/or virtual reality. Multimedia systems are used for security to keep intruders out of a system and for the protection of stored documents

4 0
3 years ago
You have installed five new 300 GB disk drives into a server running Windows Server 2012. You want to create a volume that will
Anuta_ua [19.1K]

Answer:

<em>New RAID-5 Volume </em>

Explanation:

RAID 5 <em>is a superfluous assortment of setup of independent disks using parity disk striping. </em>

Because all the disks display data and parity evenly, no single disk is a limiting factor. In the event of a disk failure, striping will also allow users to rebuild data.

RAID 5 classes have at least three and no maximum hard disk drives (HDDs). RAID 5 is deemed among the most stable RAID setups because the parity information is distributed across all drives.

5 0
3 years ago
When a program lets the user know that an invalid choice has been made, this is known as:?
kirza4 [7]

When a program lets the user know that an invalid choice has been made, this is known as a error message.

7 0
3 years ago
When discussing CV joints, Technician A says that they are called constant-velocity
Alja [10]

A only is correct.

Constant-velocity joints are able to transfer torque with zero angular velocity variation and near-zero vibration to the drive wheels at a constant rotational speed, while still accommodating the up-and-down movement of the suspension. In most cases, they are used in front wheel drive vehicles.

8 0
3 years ago
Other questions:
  • _______________ is used by a hacker to mask intrusion and obtain administrator permissions to a computer.
    7·1 answer
  • how do I comment on answers? there's one answer I'm confused about but I don't know how to comment on it
    7·2 answers
  • In a speech at a research conference, a computer expert stated that shopping centers would become obsolete in the future. He bel
    8·1 answer
  • In the transactional process model of communication, the meaning of a message resides with the ___________.
    6·1 answer
  • Twitter and facebook are both examples of the​ _____________ internet business model.
    7·1 answer
  • printArray is a method that accepts one argument, an arrayof int. The method prints the contents of the array; it does not retur
    5·1 answer
  • Match the data types to the types of value they are: Currency, Text, Date/time, and Name.
    11·1 answer
  • Codehs dartboard 3.12.4
    9·1 answer
  • Edhesive 6.8 code practice
    5·2 answers
  • Market trends on products made of bamboo, wood, and metal​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!