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
What does % find on edhesive??
statuscvo [17]

Answer:

Explanation: What is that word you typed?

3 0
3 years ago
Project 15A - Math Application
vovikov84 [41]

Answer:

A simple php code for the following is given below:

Explanation:

interface Calculate {

 public function area($lenght,$width);

 public function perimeter($length,$width);

 public function surfaceArea($length_side_1,$length_side_2);

 public funcction volume($length, $width, $height):

}

interface Calculate2 {

 public function area($raidus);

 public function perimeter($radius);

 public function surfaceArea($radius);

 public funcction volume($radius):

}

Class Mian{

 

width=please Enter the value of width

height=please Enterr the value of height

length=please enter the value of length

lenght2=please enter the value of lenth of side 2

ridus= please enter the value of radius

    Circle = new circle()

    Rectangle = new rectangle()

}

Class Circle implements Calculate2{

 

public function area(){

area= pi*r

return area

}

public function perimeter(){

perimeter=2*pi*r

return perimeter

}

public function surfaceArea(){

surfacearea= pi*r*r

}

public function volume(){}

          area=area()

   volume=area*height

      return volume

}

Class Rectangle implements Calculate{

 

public function area(lenght,width){

 area= length * width

 return area

}

public function perimeter(lenght,width){

          perimenter=2(lenght+width)

          return perimeter

}

public function surfaceArea(length_side_1, withd right place){}

       surface_area 2*length_side_1  f*  length_side_2_

public function volume(){}

public surface volume(length,width,height)

 volume= length * width * height  

 return volume

}

7 0
3 years ago
Mason is part of a project team that is creating a television advertisement. List one risk the team faces and a strategy for min
Andru [333]

One risk might be that they might use copyright music and and the music creator might take legal action.

5 0
3 years ago
In an image citation, what piece of information is listed first?
kondaur [170]
In a image citation the piece of information listed first is "last name"
can you give us multiple choice?
7 0
3 years ago
Some of the items below indicate the steps required to move a slide to a different location in a presentation. Select those step
Ivan

Answer:

Following is the order of steps needed to move a slide to different location:

First: Select the slide

Second: Hold the slide button down

Third: Drag the slide to the desired place.

N/A : Enter the slide position desired.

N/A: Select Move from the Tools menu.

N/A: Switch to the Notes view.

I hope it will help you!

8 0
2 years ago
Other questions:
  • The most effective way to perform data entry is to keep your hands on the keyboard and press to move to the text cell in the row
    10·1 answer
  • When transporting data from real-time applications, such as streaming audio and video, which field in the ipv6 header can be use
    12·1 answer
  • An element in an array is 4 bytes long and there are 10 elements in the array. How big is the array?
    6·2 answers
  • 1) Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a s
    11·1 answer
  • Which of the following is an HTTP response status type?
    12·1 answer
  • -Define three types of user mode to kernel mode transfers?
    11·1 answer
  • PLEASE HELP I mainly only need the answer for 4.
    5·1 answer
  • 3.1.1 What type of goods are car radio and remote control.​
    12·1 answer
  • Compare the two items in a summary of qualifications taken from a resumé. Which is better?
    9·1 answer
  • Taran wants to work in the technology field but is unsure of which career to pursue. He has been told he has strong people skill
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!