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
8085 microprocessor​
ohaa [14]

do you want us to write something about it or??

5 0
4 years ago
Which of these factors needs to be considered when filming in HD?
mihalych1998 [28]

Answer:

I'm going to go with b but there's a 25% thats wrong.

3 0
3 years ago
A video game controller contains the buttons: A, B, X, Y. When the player presses A their character Jumps. When the player press
Lina20 [59]

Answer:

Explanation:

The following switch statement takes in the variable button as a parameter and outputs a statement saying what the character did due to the button being pushed.

switch (Character.toLowerCase(button.charAt(0))) {

           case 'a': System.out.println("Your character has Jumped"); break;

           case 'b': System.out.println("Your character has Crouched"); break;

           case 'x': System.out.println("Your character has Punched"); break;

           case 'y': System.out.println("Your character has Flown"); break;

           default: System.out.println("Pause Menu has appeared"); break;

       }

3 0
3 years ago
An archive of files that usually contain scripts that install the software contents to the correct location on the system is ref
Anika [276]

Answer:

Option 3 is the correct answer for the above question.

Explanation:

  • A tarball is a software which is used to encrypt the other software or hide the other software and make it small. It again makes the original software program from the encrypted ones.
  • It is used to make the file sort and can use for the transfer which takes some amount of memory.
  • The above question asked about that technology which is used to make encrypted software from the original software and use it with the help of some script. Then the answer is tarball which is referred to from option 3. Hence Option 3 is the correct answer for the above question while the other is not because--
  • Option 1 states about the package manager which is used to manage the library only.
  • Option 2 states about the DBMS which is used to manage the database.
  • Option 4 states about the router which is used for the internet.

8 0
3 years ago
User defined blocks of code can be created in
lys-0071 [83]
D....................
8 0
3 years ago
Other questions:
  • On the UB-04 claim form, the type of bill is identified by a four-digit numerical code. The first digit is a leading zero, what
    10·1 answer
  • Built-in user accounts include only the Administrator account created during Windows installation True False
    15·1 answer
  • Write a program that accepts a time as an hour and minute. Add 15 minutes to the time, and output the result. Example 1: Enter t
    11·1 answer
  • HELP!!!<br> THIS HAPPENS EVERY TIME
    6·2 answers
  • when files on storage are scattered throughout different disks or different parts of a disk, what is it called
    10·1 answer
  • Write an application that prompts a user for two integers and displays every integer between them. Display There are no integers
    14·1 answer
  • You want to read input from the user to know how many apples they would like
    10·1 answer
  • Select the correct answer.
    6·1 answer
  • after landing, you are tying down the aircraft when a person approaches and asks: "faa. are you the pilot of this aircraft?" wha
    11·1 answer
  • A friend of Alex has gifted a movie collection, and Alex is excited to watch them all as quickly as possible. The duration of th
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!