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
insens350 [35]
3 years ago
7

Write an application that displays every perfect number from 1 through 1,000. A perfect number is one that equals the sum of all

the numbers that divide evenly into it. For example, 6 is perfect because 1, 2, and 3 divide evenly into it, and their sum is 6; however, 12 is not a perfect number because 1, 2, 3, 4, and 6 divide evenly into it, and their sum is greater than 12.
Computers and Technology
1 answer:
matrenka [14]3 years ago
5 0

Answer:

Written in Python

for num in range(1,1001):

    sum=0

    for j in range(1,num+1):

         if num%j==0:

              sum = sum + j

                   if num == sum:

                        print(str(num)+" is a perfect number")

Explanation:

This line gets the range from 1 to 1000

for num in range(1,1001):

This line initializes sum to 0 for each number 1 to 1000

    sum=0

This line gets the divisor for each number 1 to 1000

    for j in range(1,num+1):

This following if condition line checks for divisor of each number

<em>          if num%j==0: </em>

<em>               sum = sum + j </em>

The following if condition checks for perfect number

                   if num == sum:

                        print(str(num)+" is a perfect number")

You might be interested in
Macy reviewed Steve's presentation. Images in the slides were distracting from the presentation. What advice should
murzikaleks [220]
From what i learned from school, have a theme for the presentation and only have 1-3 pictures per slide that aren’t too big but small enough so you can read and see, also pictures that are self explanatory
8 0
3 years ago
Read 2 more answers
Ladders are a fundamental piece of equipment on construction sites and employers are expected to ensure that workers follow safe
Ede4ka [16]
That statement is true.

Ladders commonly used to do a couple of construction activities in a higher region of a building or area.
If this equipment is not used properly, it could potentially caused  fatal accidents for the people on the site
6 0
3 years ago
IF U LOVE CODING CLICK HERE!!! : )
erik [133]

Answer:

I think it is the last one. Or first. Try first though.

Explanation:

Have a Great Day.

8 0
3 years ago
According to the Modern Language Association (MLA) style guidelines, which citation is formatted correctly?
aalyn [17]
A) Marian Shelby. “The Fall of Rome.” Military Forces. n.p., 11 Mar 2009. Web.
14 Oct 2012.
4 0
3 years ago
Read 2 more answers
What is the abbreviation used for educational sites/?
Dovator [93]
Mainly .com 
educational institutes .edu
8 0
2 years ago
Other questions:
  • Software license infringement is also often called software __________.
    11·2 answers
  • Building relationships during your career exploration is called
    9·2 answers
  • The lightbulb transfers electricity energy into light what is one type of energy that is also generated that is not a desired af
    14·1 answer
  • What is thought to have caused the extinction of the dinosaurs?
    13·1 answer
  • Explain the<br>4 ways<br><br>ways of arranging icons.<br><br>​
    6·1 answer
  • Which phrase best describes a scenario in Excel 2016?
    5·2 answers
  • How do you measure the capacity of speed and memory of computer system<br>Explain.​
    13·1 answer
  • Your team has provisioned an Auto Scaling Groups in a single Region. The Auto Scaling Group at max capacity would total 40 EC2 i
    14·1 answer
  • True or false. The send e-mail feature, listed under tools, will allow you to send an e-mail to your instructor and to fellow st
    7·1 answer
  • (lesson 7.9: acceptance-rejection --- continuous examples.) consider the constant . on average, how many iterations (trials) wil
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!