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
Write an expression that computes the average of the values 12 and 40.
Lady bird [3.3K]

Answer:

The answer to this question is given below in the explanation section

Explanation:

The expression that computes the average of value 12 and 40 is given below:

average = (12+40)/2;

in programming language we can write this expression as like;

int average = (12+40)/2;

8 0
3 years ago
What do we call notes in computer code for the programmer that are ignored by the compiler?.
Lelu [443]

The notes in computer code for the programmer that are ignored by the compiler is called a comment.

<h3>What are codes in programming?</h3>

Codes in programming are specific sequences or sets of instructions that are made for specific programs. They are written in a specific language. They are made to make a human-friendly language. Codes are made after the compiler confirms them.

Comments are written for the document. They tell what the document is for, and how the document is constructed.

Thus, the notes on the computer code for the programmer are called a comment.

To learn more about comments in computer code, refer to the link:

brainly.com/question/18340665

#SPJ4

4 0
1 year ago
What is the definition of the word uproot?
avanturin [10]
Uproot means to pull something out of the ground, when a tree is uprooted, It is pulled out of the ground
4 0
2 years ago
When powering off your computer is best down using?
MAXImum [283]

command prompt shutdown/s or alt f4


7 0
3 years ago
Read 2 more answers
The encapsulation unit on the presentation layer of the osi model is
Zielflug [23.3K]
<span>The encapsulation unit on the presentation layer of the OSI model is the Data link layer (2).</span>
7 0
3 years ago
Other questions:
  • It's time for you to schedule a dental checkup. The responsible thing to do is to ___
    11·1 answer
  • Write the following function without using the C++ string class or any functions in the standard library, including strlen(). Yo
    12·1 answer
  • Karen has opened a new business and is using Google Display Ads to build awareness of her new products. How does Google Display
    6·1 answer
  • How assemblers and linkers work together?
    13·1 answer
  • Janice, who is 15, posts a picture of herself drinking alcohol and making an obscene gesture on her social networking page. Whic
    11·2 answers
  • On laptops, wireless cards tend to be attached to which panel?
    8·1 answer
  • In the table below identify the data type that would be most suitable for the second field
    14·1 answer
  • Return a version of the given string, where for every star (*) in the string the star and the chars immediately to its left and
    11·1 answer
  • I made Pico with a Ray Gun (Next is Dad/Tankman)<br><br> Opinons?
    11·2 answers
  • Write a pseudocode that receives a positive number from the user, and then,
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!