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
Jamal wants to write a program that will find the 10 most common words in Romeo and Juliet. Which of the following constructs wi
arlik [135]

Answer:

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

Explanation:

The correct answer to this question is A: counter module.

Counter module in python or Python counter is a container that holds the count of each of the elements present in the container. It is a sub-class available in the dictionary class. Jamal can use this module in Python to write a program that will find the 10 most common words in Romeo and Juliet.

Other options are not correct because:

While loop: while loop only iterates its body until a specific condition is met. For loop is used to iterate to a pre-specified condition and iterate until the condition is reached. While the mean module of Python is used to calculate mean and average.

6 0
3 years ago
The commands available from a menu do not change. True or false
jeka94

i believe this will be false


3 0
3 years ago
Read 2 more answers
Database developers use the ________ to create relationships in the database.
madreJ [45]
Is it multiple choice ?<span />
7 0
4 years ago
Define the term output devices​
expeople1 [14]

So a output device is anything that can output info from the computer so

we are read and understand it some are a printer monitor and soundboard

Hope this helped

-scav

6 0
3 years ago
In which of the following scenarios would you choose to embed versus import data?
Mrrafil [7]

Answer:

B.)You want to maintain connections with external files

Explanation:

These are the options for the question

A.)You do not want to save the original data sources.

B.)You want to maintain connections with external files

C.)You want to reduce file size

Embedding data can be regarded as insertion of objects( embedded object) such as spreadsheet into a word-processor so that it can be edditted.

Data Import can be regarded as ways that give room for uploading of data

from external sources , then combine it with data that is been collected via Analytics.

6 0
3 years ago
Other questions:
  • Does group policy management matter without a server environment?
    7·1 answer
  • Enterprise application integration (eai) software enables users to model the business processes and interactions that should occ
    8·1 answer
  • Can someone please help me with the three questions please?
    6·1 answer
  • (BRAINLIEST FOR FIRST CORRECT ANSWER) Mark (all) the statements that best describe the use of spreadsheets and tables in present
    15·1 answer
  • (Help please I don't know what to choose because it's both text and email but I can only pick one. HELP!!!!!!!!!!)
    6·2 answers
  • Question :
    6·1 answer
  • Anybody wanna be friends?
    10·2 answers
  • A computer is assigned an IP address of 169.254.33.16. What can be said about the computer, based on the assigned address?
    9·1 answer
  • A natural language processor reads the sentence The walk was tiring and mistakes the noun “walk” as a verb. What is such an erro
    13·1 answer
  • What are price comparison websites?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!