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]
2 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]2 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
The ______ clause allows us to select only those rows in the result relation of the ____ clause that satisfy a specified predica
baherus [9]

Answer:

1. Where,

2. From

Explanation:

In SQL query language when working on a database, a user can use certain clauses to carry out some functions.

Hence, The WHERE clause allows us to select only those rows in the result relation of the FROM clause that satisfy a specified predicate.

This is because the "Where clause" selects the rows on a particular condition. While the "From clause" gives the relation which involves the operation.

5 0
2 years ago
Which search strategy is most similar to greedy search?
lesya692 [45]

Answer:

I think the answer would be A.

Explanation:

If I'm wrong plz let me know (I think I may be wrong)

8 0
3 years ago
It is important to analyze the sources and uses of cash because:___.
sergey [27]

It is important to analyze the sources and uses of cash because creditors use this information to assist them in deciding whether to loan funds to them. Investors use this information to decide if they will purchase their stock.

Managing your revenue is an important step to starting or investing in something.

Creditors always check and properly analyze the sources of cash before providing a loan to a lender. They do not invest in companies or people who are least likely to source and make cash in the coming time. Hence, your sources and uses shall be properly analyzed when presenting to creditors.

Investors, whenever investing in something will look at the benefits of the source they want to invest into. If a source is not likely to produce beneficiary revenue in the upcoming time, then investors will never invest in such a kind of source.

To learn more about investors, click here:

brainly.com/question/25311149

#SPJ4

5 0
1 year ago
Dave and Kirk are learning about electromagnetic waves in class. Dave says that gamma rays are the most dangerous because they c
katen-ka-za [31]

I’d say A: Dave is partly right in his answer that gamma rays are the most dangerous, but it is because of their frequency and wavelength, not where they come from.

Gamma rays are the most intense and thus, most harmful electromagnetic waves. Gamma rays radiation poisoning is difficult to shield against. These rays have the most energy and can go through six feet of concrete and damage your DNA as well. The higher the energy waves (gamma, x-ray), the shorter the wavelengths

7 0
3 years ago
A company that connects through your communications line to its server, which connects you to the Internet, is a(n)
hammer [34]
Internet server provider
4 0
3 years ago
Other questions:
  • Ann wants to download Adobe Acrobat software from the Internet. Prior to downloading, a standardized online contract appears on
    7·1 answer
  • The superclass Calculator contains: a protected double instance variable, accumulator, that contains the current value of the ca
    5·1 answer
  • You have a site (Site1) that has about 20 users. For the last few months, users at Site1 have been complaining about the perform
    9·1 answer
  • What is the Kali Linux's kernel?<br><br> Sorry for english, but help me.
    12·1 answer
  • List the seven basic internal components found in a computer tower
    7·1 answer
  • Which of the following is a quick way to restore the arrow pointer after you have used it for drawing?
    5·1 answer
  • What is a Software that interprets commands drom the keyboard and mouse
    13·1 answer
  • What is a killer app??
    10·1 answer
  • When you purchase donuts, they come in boxes of 12, so 24 donuts take 2 boxes. All donuts need to be in a box, so if you buy 13
    10·1 answer
  • Web designers use programming languages to write websites. A True <br> B False​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!