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
vladimir2022 [97]
3 years ago
12

A positive integer is called a perfect number if it is equal to the sum of all of its positive divisors, excluding itself. For e

xample, 6 is the first perfect number because 6 = 3 + 2 + 1. The next is 28 = 14 + 7 + 4 + 2 + 1. There are four perfect numbers less than 10,000. Write a program to find all these four numbers.
Computers and Technology
1 answer:
Ad libitum [116K]3 years ago
5 0

i = 1

while i < 10001:

   total = 0

   x = 1

   while x < i:

       if i % x == 0:

           total += x

       x+=1

   if total == i:

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

   i += 1

When you run this code, you'll see that 6, 28, 496, and 8128 are all perfect numbers.

You might be interested in
Write a WHILE loop that lets the user enter a number.
balandron [24]

Answer:

while True:

   number = int(input("Enter a number: "))

   product = number * 10

   if product > 100:

       break

print(str(product))

Explanation:

Create a while loop that iterates until a specific condition is created inside

Ask the user for the input

Multiply the input and put the result in product

Check if the product is greater than 100. If it is, stop the loop using break keyword

When the loop is done, print the product

7 0
3 years ago
what is the worst-case big o running time for finding the maximum value in an array of size n by scanning from left to right and
Aleksandr-060686 [28]

Answer:

spanish

Explanation:

no ingles a me pisquen spanish soy tu amigos teacher

6 0
1 year ago
HURRY PLEASE ITS A TEST
laiz [17]

<em>A.)</em>

<em>It's either A or D both of them stand out and make sense to me so I think that it'll be right if you choose A or D.</em>

<em>-Ɽ3₮Ɽ0 Ⱬ3Ɽ0</em>

8 0
3 years ago
You can easily view the ruler on a document by selecting the Show Ruler button located _____.
Ket [755]
In the “View” tab in the Ribbon.
7 0
2 years ago
Read 2 more answers
Most GUIs provide all of the following except _____.
erma4kov [3.2K]

Hello there! Your answer would be A.

GUIs are Graphical user interfaces. Command prompts are unique to Windows operators, so your best option would be A since the question covers most GUIs.

Hope this helps, have a great day!

7 0
3 years ago
Other questions:
  • Instructions:Select the correct answer.
    13·1 answer
  • _____ assures the interface will act as the users expect, while _____ assures it will look pleasing. Select one:
    14·1 answer
  • The magnavox odyssey was a commercial success
    13·1 answer
  • This program has some errors in it that are needed to be checked import java.io.*;
    13·1 answer
  • To move up one paragraph, press the ____ key(s). f1 alt up arrow up arrow ctrl up arrow
    8·1 answer
  • A review of the sales, costs, and profit projections for anew product to find out whether these factors satisfy the company'sobj
    15·1 answer
  • Consider the problem of solving two 8-puzzles.
    10·1 answer
  • Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have me
    10·1 answer
  • An article explaining the uses of the parts of a computer​
    14·1 answer
  • What type of volcano is Dukono
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!