subject

Sublist(xs, total)'
Description: It finds the smallest square-size sublist of a 2D list xs that the sum of its values is greater than or equal to total. Minimum size of a sublist is 2x2. If there are more than one equally sized sublists that satisfy the requirements, it returns the one with the largest sum.
If no sublist satisfies the requirements it returns False.

Parameters: xs (list of list of int), total (int). You’re not allowed to modify xs.
Return value: a square size list of list of int
Example:
sublist([[0,1,2], [-4,5,6), [7,8,3]],5) → [[5,6],[8,3]]
sublist([[0,1,2], [-4,5,6], [7,8,3]], 23) → [[0,1,2], [-4,5,6],[7,8,3]]

Code this in python 3.
•Built-in functions: range(),len(),int(),str()
•list methods: .append(), .insert()
•Not allowed to use slicing
•allowed to use the del operator

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 15:30, jokerr6323
1. ask the user how many questions are in the quiz. 2. ask the user to enter the key (that is, the correct answers). there should be one answer for each question in the quiz, and each answer should be an integer. e. g., 34 7 13 100 81 3 9 10 321 12 might be the key for a 10-question quiz. you will need to store the key in an array. 3. ask the user to enter the answers for the quiz to be graded. there needs to be one answer for each question. note that these answers do not need to be stored; each answer can simply be compared to the key as it is entered. 4. when the user has entered all of the answers to be graded, print the number correct and the percent correct. 5. add a loop so that the user can grade any number of quizzes with a single key. after the results have been printed for each quiz, ask "grade another quiz? (y/n)." note: you only have one array (the key). you are not creating a new key for each set of quiz answers.
Answers: 3
image
Computers and Technology, 23.06.2019 21:50, Trinhphuongtran
Description: write function lastfirst() that takes one argument—a list of strings of the format "lastname, firstname" —and returns a list consisting of two lists: (a) a list of all the last names (b) a list of all the first names
Answers: 2
image
Computers and Technology, 24.06.2019 08:30, trashellyoung
Why might you choose to create a functional resume
Answers: 1
image
Computers and Technology, 24.06.2019 16:00, miner12924owhu4d
5.a fishing rod is formed from a composite material of 0.5 kg of glass fibers embedded in a matrix of 0.5 kg of epoxy resin. the glass fibers are assumed to be long, continuous and unidirectional. to achieve a greater stiffness it is proposed to use a different composite that is comprised of long continuous carbon fibers that will be embedded in a matrix of 0.5 kg of epoxy resin. if the modulus of elasticity of the carbon fiber composite is 10% greater than the elastic modulus of the glass fiber composite, estimate the mass of carbon fibers that will be used to make the carbon fiber composite. assume the applied tensile stress is parallel to the direction of the long axis of the fibers. the epoxy resin, glass fiber, and carbon fiber have an elastic modulus of 5, 86, and 350 gpa respectively and a density of 1100, 2500, and 1800 respectively.
Answers: 3
You know the right answer?
Sublist(xs, total)'
Description: It finds the smallest square-size sublist of a 2D list xs tha...

Questions in other subjects:

Konu
Social Studies, 12.04.2021 17:10
Konu
Mathematics, 12.04.2021 17:10