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
Self-disclosure is most likely to occur _____________.a.
Feliz [49]

The answer is..

C.  During one-on-one conversations

4 0
3 years ago
Read 2 more answers
Which tools can be used to scale an object? Check all that apply.
meriva

Answer:

format picture pane

corner sizing handles

Explanation:

7 0
3 years ago
Why do companies implement new technology?Select all that apply.
Wittaler [7]
All of them are correct except the last one
6 0
3 years ago
To insert a clip art you must do the following
Elis [28]

In word (.docx) or powerpoint (.ppt), one can insert images. These images may come from the internet online and other avenues for inserting images. If one does not have internet at home, he could opt to using the ‘clip arts’ where you click ‘Insert’ in the home bar up, and click clip art.

<span> </span>

5 0
4 years ago
Does -8 = -21?<br>[this is NOT a trick question]<br>Yes....?<br>No!​
Rudiy27

Answer:

No.

Explanation:

From my knowledge, negative 8 is 8 units to the left of zero, while 21 is 21 units to the left.

This means that they are two different negative numbers! If you see an equation like this, it would be labeled as false.

I'm quite sure I am correct, tell me so if otherwise! :)

#SpreadTheLove

8 0
3 years ago
Read 2 more answers
Other questions:
  • A _______ file is a type of vector graphics file created specifically for Windows.
    13·2 answers
  • Match the function to its purpose.
    8·1 answer
  • A series of four or five comparisons and calculations that together determine an employee's withholding tax value might be group
    6·1 answer
  • You can create a negative indent, sometimes called a(n) ________________, by dragging the indent markers on the ruler to the lef
    12·1 answer
  • Please answer fast - screenshot included.
    5·1 answer
  • If you’re storing some personal information like Debit/Credit card numbers or Passwords etc, on different sites for running you’
    10·1 answer
  • Which type of storage disk and disk drive can you use in the given situation?
    9·1 answer
  • During the morning of a website launch for a new government sponsored healthcare portal, an unknown political rival, individual,
    15·1 answer
  • You recently created a new network segment for the development department. Because the hosts are now on a different network segm
    6·1 answer
  • How does a fully integrated Data and Analytics Platform enable organizations to convert data into consumable information and ins
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!