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
A carver begins work on the following block of granite that weighs 2700 g. What is the density of the granite?
bogdanovich [222]

Given that,

Mass of the block, m = 2700 g

Let the dimensions of the block are 20 cm, 5 cm and 10 cm.

To find,

The density of the granite.

Solution,

Let d is the density of the granite. We know that the density of an object is equal to the mass per unit volume. So,

d = m/V

or

d=\dfrac{2700\ g}{20\ cm\times 5\ cm\times 10\ cm}\\\\d=2.7\ g/cm^3

So, the density of the block is 2.7 m/s².

8 0
3 years ago
How can you exaggerate the height of a jump in a photograph
Nataliya [291]

If you take the photo with one person on the ground that way when they take the photo it will look like the person jumping is jumping higher then they really are.


I hope this helps

8 0
3 years ago
It is important to understand the different types of DoS attacks and the symptoms of those attacks. Leaving a connection half op
solong [7]

Answer:

SYN flood attack.

Explanation:

Doing this is a symptom of an SYN flood attack. Attackers performing this type of DoS attack will try and open as many connections as possible but never fully finish the connection. This ultimately causes the system to use all of its computing power to try to resolve these failed connections which would cause the system to crash or become unresponsive. Therefore, denying service to potential clients if done correctly. This is just one of the many types of DoS attacks that exist.

8 0
3 years ago
NO THIS ISNT ANY HOMEWORK!
IRISSAK [1]

Answer:

you can run minecraft on virtually anything with the lowest settings and optifine, as long as you dont use shaders or beefy texture packs

Explanation:

4 0
3 years ago
Read 2 more answers
U GET BRAINLIEST HELP PLZ
Art [367]
BOTH OF THEM ARE C : )
3 0
3 years ago
Other questions:
  • The design activity key question, "how will this system interact with other systems..." is part of which design activity?​
    7·1 answer
  • What feature would be used to collect how many times users downloaded a product catalog?
    11·1 answer
  • What are the reasons why is it necessary to evaluate online sources and content?
    6·1 answer
  • For C programming language, what does it mean when you have an exclamation mark after an equal sign? ie:
    5·1 answer
  • Which structure is the following true for? For _________, arguments are substituted exactly as entered, without checking for mem
    6·1 answer
  • Web and mobile applications are created for users to only read information. True False
    15·2 answers
  • Research and discuss the LAMP (Linux, Apache, MySQL, and PHP) architecture. What is the role of each layer of this software stac
    14·1 answer
  • Which of the following is not a SQL*Loader file?
    11·1 answer
  • Emma downloaded a new game from an unfamiliar website. A few days later, Emma realized her system had been hacked and her credit
    7·1 answer
  • Private notes about individual slides that you leave for yourself or for others who might use the presentation file is called __
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!