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
it is a program a personal computer microprocessor uses to get the computer system started after you turn it on​
Fofino [41]

Explanation:

please repeat your question

5 0
3 years ago
Which feature of spreadsheet software can display numerical data in a visually appealing and easily understood format
Bad White [126]
A table maker makes visually appealing tables such as line graphs, bar graphs, venn diagrams on a spreadsheet software. 
8 0
3 years ago
Read 2 more answers
In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After statement cin >> one >>
melisa1 [442]

Answer:

The answer is "Option d"

Explanation:

In the given C++ program code, It is defined, that two double type variable "one and two" is defined, that holds the two double value that is "10.5 and 30.6".

In this code, it uses the "cin" method for input values from the user ends, when we execute this code, it provides the console screen, that inputs the double type value from the user side, and other given choices were wrong because it holds different values.

3 0
4 years ago
You have placed a File Transfer Protocol (FTP) server in your DMZ behind your firewall. The FTP server is to be used to distribu
VladimirAG [237]

The steps should follow to enable the access is open ports 20 and 21 for inbound and outbound connections.

<h3>What is FTP?</h3>

File transfer protocol is a communication protocol used to transfer files from a device to a client on a computer network.

You must open the correct ports on the firewall to allow FTP traffic into your DMZ. For outbound FTP connections, the correct ports are 20 and 21.

Thus, the steps should follow to enable the access is open ports 20 and 21 for inbound and outbound connections.

Learn more about FTP

brainly.com/question/25751600

#SPJ1

8 0
2 years ago
The ____ system is an example of a single-user Earth station satellite system with its own ground station and a small antenna (t
White raven [17]

Answer: VSAT(Very Small Aperture Terminal)

Explanation:

The computer system could be connected to the transceiver via an antenna and can send and receive data.

Using satellite communication the data could be send to the end user.

3 0
4 years ago
Other questions:
  • A ________ is when teachers develop a professional based network of people selected by him/her to pursue learning needs and shar
    12·1 answer
  • What does the acronym vsepr represent {spelling is important} question 1 options:?
    12·1 answer
  • Is there a way to search your computer for all music files on it?
    9·1 answer
  • 2. (40 POINTS) Assume a 16-word direct mapped cache with b=1 word is given. Also assume that a program running on a computer wit
    12·1 answer
  • As a bank employee, you often work from home and remotely access a file server on the bank’s network to correct errors in financ
    8·1 answer
  • If everyone's choice for their computer printer were an hp laserjet 4100, there would be a ___ preference segment in the compute
    8·1 answer
  • In printing systems using ____, a disk accepts output from several users and acts as a temporary storage area for all output unt
    14·1 answer
  • _________ cards contain a chip that can store a large amount of information as well as on a magnetic stripe for backward compati
    12·1 answer
  • Administrators who are wary of using the same tools that attackers use should remember that a tool that can help close an open o
    6·1 answer
  • Why might it be important to be careful when placing multiple microphones around the same sound source
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!