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
Which visual aids can be used to present large amounts of numerical data from multiple sources? Check all that apply.
alexdok [17]

Answer:

The correct answers would be <u>B.) a line graph</u> and <u>D.) a bar graph</u>

Explanation:

I just did the assignment on edge 2020 and got it right

6 0
3 years ago
What is the maximum number of colors that should be used on a slide?
gavmur [86]
The most commonly accepted amount of colors on one slide is 4
7 0
3 years ago
Read 2 more answers
Group of answer choices When declaring a variable, you also specify the type of its values. Variables cannot be assigned and dec
olga nikolaevna [1]

Complete Question:

Which of the following statement is true?

Group of answer choices.

A. When declaring a variable, you also specify the type of its values.

B. Variables cannot be assigned and declared in the same statement.

C. Variable names can be no more than 8 characters long.

D. Variable names must contain at least one dollar sign.

Answer:

A. When declaring a variable, you also specify the type of its values.

Explanation:

In Computer programming, a variable can be defined as a placeholder or container for holding a piece of information that can be modified or edited.

Basically, variable stores information which is passed from the location of the method call directly to the method that is called by the program.

For example, they can serve as a model for a function; when used as an input, such as for passing a value to a function and when used as an output, such as for retrieving a value from the same function. Therefore, when you create variables in a function, you can can set the values for their parameters.

For instance, to pass a class to a family of classes use the code;

\\parameter Name as Type (Keywords) = value;

\\procedure XorSwap (var a,b :integer) = "myvalue";

<em>Hence, the true and correct statement is that when declaring a variable, you also specify the type of its values such as integers, string, etc. </em>

6 0
3 years ago
Write the UPDATE command to increase the commission (column name :COMM) by 500 of all the salesman who have achieved sales (Colu
lara31 [8.8K]

Answer:

UPDATE COMPANY

SET COMM=COMM + 500

WHERE SALES> 20000;

Explanation:

The update command is used for alter the record in the database management system in the table .The update command command modify the record on the some condition in the table in the database management system.

Following are syntax for using the update command .

UPDATE table-name

SET column name 1,column name 2 .........

Where condition

  • In the given question table -name is "COMPANY" the condition is on the sales column and it update the table only when sales is more than 20000 and set the column COMM by 500.
4 0
3 years ago
How do you write 124.59 in expanded form?
scZoUnD [109]
124.59 in expanded form is:

100 + 20 + 4 + 0.5 + 0.09
8 0
3 years ago
Read 2 more answers
Other questions:
  • Industrial Products is a small light-manufacturing firm that produces a variety of control systems for heavy industry. It has a
    13·1 answer
  • What is the purpose of the BBC option in a email?
    7·1 answer
  • How can you efficiently restrict the read-only function of a requesting SNMP management station based on the IP address?
    14·1 answer
  • Please Help!! How to code this in Python?
    11·1 answer
  • If you could make another device "smart" and have
    12·1 answer
  • A or an is a simple chip with two or more processor core
    5·1 answer
  • The graphic shows a cause and effect organizational aid.
    6·1 answer
  • The Self-Quiz gives you an opportunity to self-assess your knowledge of what you have learned so far.
    13·1 answer
  • 2. Explain the difference between a JMP instruction and CALL instruction
    6·1 answer
  • Do you have any sprites for Friday Night Funkin?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!