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
KiRa [710]
3 years ago
15

Complete the divisible_by(list1, int1) function below. As input, it takes a list of integers list1 and an integer int1. It shoul

d return a list with all the integers in list1 where the integer is divisible by int1. For example, divisible_by([2, 9, 4, 19, 20, -3, -15], 3) should return the list [9, -3, -15].
1 def divisible_by(listi, n):
2 # code goes here
3 pass
4
5 if _name == "__main__":
6 # use this to test your function
7 test_list = [2, 9, 4, 19, 20, -3, -15]
8 print(divisible_by(test_list, 3))
Computers and Technology
1 answer:
damaskus [11]3 years ago
5 0

Answer:

The function is as follows:

def divisible_by(listi, n):

   mylist = []

   for i in listi:

       if i%n == 0:

           mylist.append(i)

   return mylist

   pass

Explanation:

This defines the function

def divisible_by(listi, n):

This creates an empty list

   mylist = []

This iterates through the list

   for i in listi:

This checks if the elements of the list is divisible by n

       if i%n == 0:

If yes, the number is appended to the list

           mylist.append(i)

This returns the list

   return mylist

   pass

You might be interested in
What does a cascading style sheet resolve a conflict over rules for an element?
Margaret [11]
I Think The answer is d I hope it helps
4 0
3 years ago
Explain: The decode part of fetch decode execute cycle
egoroff_w [7]

Answer:

Image below

Explanation:

5 0
3 years ago
Read 2 more answers
I WILL STAR YOU AND THANKS YOU!!!!!!!!!!!!!!!!
lord [1]
The answer seems to be polymerization.
 
8 0
3 years ago
Determine the type of plagiarism by clicking the appropriate radio button.
AleksAgata [21]

Answer:

a)

Explanation:

From the writing of the student, it shows that he plagiarized the work word for word, in that

1. There was the page number of the article in his writing

2. In addition, the reference shouldn't have been added at this stage of writing but the student did added it.

5 0
3 years ago
Consider the use of 1000-bit frames on a 1-Mbps satellite channel with a 270-ms delay. What is the maximum link utilization for,
natka813 [3]
I feel as if it would be B.
5 0
3 years ago
Other questions:
  • I need someone whos really good with computers to help me with some things
    12·1 answer
  • _______ computing refers to applications and services that run on a distributed network using virtualized resources.
    14·1 answer
  • Which of these engine components forms a tight seal between the piston and the cylinder and is necessary for proper engine opera
    13·2 answers
  • Which of the following reflects Moore's law? Multiple Choice The doubling of computer chip performance per dollar every two year
    11·1 answer
  • It is an array containing information such as headers, paths and script locations wherein it is created by the web server itself
    8·1 answer
  • What's the main idea??
    12·1 answer
  • I wiil mark brainlist ​
    8·1 answer
  • A reputable, world-renowned auction house uses blockchain to verify the authenticity of paintings prior to placing them up for s
    7·1 answer
  • Determina la cilindrada total Vt en un motor de 4 cilindres de 83,6 mm de diàmetre per 91 mm de cursa.
    8·1 answer
  • What will the computer do in response to a line of code reading # name = input("What is your name?")
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!