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
scoray [572]
3 years ago
6

Def sum_divisors(n): sum =1 # Return the sum of all divisors of n, not including n x=int(n**0.5) for i in range(2,(x//1)+1): if

n%i==0: sum=sum+i if n%i==0 and n/i!=i: sum=sum+(n/i) return sum print(sum_divisors(0)) # 0 print(sum_divisors(3)) # Should sum of 1 # 1 print(sum_divisors(36)) # Should sum of 1+2+3+4+6+9+12+18 # 55 print(sum_divisors(102)) # Should be sum of 2+3+6+17+34+51 # 114
Computers and Technology
1 answer:
Novosadov [1.4K]3 years ago
6 0

Answer:

This is a python program that counts the number of divisors of a given number and calculates the sum of the divisors.

Explanation:

The first line defines a function "sum_divisors" with an argument "n". The square root of the argument is converted to integer and assigned to the variable "x", then a for loop is used to iterate through the range 2 to the calculated nth number of divisors in the argument.The return keyword returns the sum value.

The function is called with several arguments and printed with the print function.

You might be interested in
Name and describe one of three types of sensitive information.
klemol [59]

Answer:

The three main types of sensitive information that exist are: personal information, business information and classified information.

7 0
3 years ago
Nina is explaining the SQA process to her friend Amanda.
Nezavi [6.7K]
<span>B. Plan
</span><span>C. Planning
yes or no</span>
4 0
3 years ago
Hye I'm new branily I don't no use in this aap please follow me​
mixas84 [53]
Um ok? I think u have to have more points to be able to follow people tho
8 0
3 years ago
Which aspect of nature inspired the invention of Velcro
lesya692 [45]

Burrs from plants (APEX)

8 0
4 years ago
Help me to write spaghetti stack function, please!!
Mariulka [41]
Pointer tree is here

7 0
3 years ago
Other questions:
  • In normal view, powerpoint's ________ contains buttons such as notes, comments, and view.
    14·1 answer
  • What web page has html file that exists on web server?
    10·1 answer
  • Write a program segment that simulates flipping a coin 25 times by generating and displaying 25 random integers, each of which i
    5·1 answer
  • Should you configure if you want to limit access to files with certain classifications within a folder to a specific security gr
    13·1 answer
  • Fill in the blank
    15·1 answer
  • Consider an unpipelined or single-stage processor design like the one discussed in slide 6 of lecture 17. At the start of a cycl
    10·1 answer
  • Guys for those who are familiar to bubble gum sim...THERE IS A HUGE EVENT AND I DONT WANT TO FAIL AN EVENT...(again) is anyone w
    9·1 answer
  • What is the way to discover requirments for software projects ?
    14·1 answer
  • Is a free verse a poetry that has no images
    5·2 answers
  • Team members can collaborate on ideas using telepresence. <br> true or false?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!