subject

Complete the divisible_by(list1, int1) function below. As input, it takes a list of integers list1 and an integer int1. It should 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))

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:00
Suppose you have 9 coins and one of them is heavier than others. other 8 coins weight equally. you are also given a balance. develop and algorithm to determine the heavy coin using only two measurements with the of the balance. clearly write your algorithm in the form of a pseudocode using the similar notation that we have used in the class to represent sorting algorithms
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
Which type of excel chart should be used to track students’ progress on test grades? line column bar pie
Answers: 2
question
Computers and Technology, 24.06.2019 22:10
How many different ways are there to order the eight jobs in the queue so that job usu comes somewhere before cdp in the queue (although not necessarily immediately before) and cdp comes somewhere before bbd (again, not necessarily immediately before)?
Answers: 1
question
Computers and Technology, 25.06.2019 09:00
What are some of the things many ctsos do for their members ?
Answers: 1
You know the right answer?
Complete the divisible_by(list1, int1) function below. As input, it takes a list of integers list1 a...
Questions
question
Mathematics, 13.02.2021 03:40
question
Social Studies, 13.02.2021 03:40
question
Mathematics, 13.02.2021 03:40
Questions on the website: 13722361