Given a nested list named table, use a loop to print each sublist of the nessted list. The sublists should be on their own line. For example: Test Result table 10, 9, 8], [7,6,5] [10, 9, 8] [7, 6, 5] Answer:(penalty regime: 0 %) 1 for row_idx in range(len(table) ) for col_idx in range(len(table [ row_idx])) print(table[row_idx][col_idx]) 2 Check Test Expected Got 4] 'one', 'two'] table = [ [ "one", "two"], [ 1, 2], ["three", "four"], [ 3 one [1, 2] two ['three', 'four'] 1 [3, 4 three four 4 [[ 10, 9, 8], [7,6,5]] [10, 9, 8 table 10 [7, 6, 5] 7 6 table [["cat"], "dog"], ["mouse"]] ['cat' cat ['dog' dog ['mouse' mouse Your code pass all tests to earn any marks. Try again. Show differences

Question

I have tried this  a few times and cannot figure it out. This is for python.

 

Given a nested list named table, use a loop to print each sublist of the nessted list. The sublists should be on their own line.
For example:
Test
Result
table
10, 9, 8], [7,6,5] [10, 9, 8]
[7, 6, 5]
Answer:(penalty regime: 0 %)
1 for row_idx in range(len(table) )
for col_idx in range(len(table [ row_idx]))
print(table[row_idx][col_idx])
2
Check
Expand
Transcribed Image Text

Given a nested list named table, use a loop to print each sublist of the nessted list. The sublists should be on their own line. For example: Test Result table 10, 9, 8], [7,6,5] [10, 9, 8] [7, 6, 5] Answer:(penalty regime: 0 %) 1 for row_idx in range(len(table) ) for col_idx in range(len(table [ row_idx])) print(table[row_idx][col_idx]) 2 Check

Test
Expected
Got
4] 'one', 'two']
table
= [ [ "one", "two"], [ 1, 2], ["three", "four"], [ 3
one
[1, 2]
two
['three', 'four'] 1
[3, 4
three
four
4
[[ 10, 9, 8], [7,6,5]]
[10, 9, 8
table
10
[7, 6, 5]
7
6
table
[["cat"], "dog"], ["mouse"]]
['cat'
cat
['dog'
dog
['mouse'
mouse
Your code
pass all tests to earn any marks. Try again.
Show differences
Expand
Transcribed Image Text

Test Expected Got 4] 'one', 'two'] table = [ [ "one", "two"], [ 1, 2], ["three", "four"], [ 3 one [1, 2] two ['three', 'four'] 1 [3, 4 three four 4 [[ 10, 9, 8], [7,6,5]] [10, 9, 8 table 10 [7, 6, 5] 7 6 table [["cat"], "dog"], ["mouse"]] ['cat' cat ['dog' dog ['mouse' mouse Your code pass all tests to earn any marks. Try again. Show differences

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: You are given a function called is_prime  which consumes a positive number and returns True if the n...

A: Before solving this question first, you should know some functions definitions :Prime number: Primar...

Q: Find the truth table that describes the following circuit.

A: The diagram shown below is taken from the given question- 

Q: Suppose you have two tables: EMPLOYEE and EMPLOYEE_1. The EMPLOYEE table contains the records for th...

A: Two tables are given named as EMPLOYEE and EMPLOYEE1. Each table has its records. EMPLOYEE table has...

Q: One of the inital versions of the rules for an MLFQ scheduler was: “Rule 1: If Priority(A)>Priori...

A: This problem is referred to as Starvation or Indefinite Blocking.Starvation: Starvation is the condi...

Q: Suppose that a maximum flow network contains a node, other than the source node, without incoming ar...

A: Maximum flow problem:“Yes”, it is possible if the maximum flow network does not contain source node ...

Q: Write an application to pre-sell a limited number of cinema tickets. Each buyer can buy as many as 4...

A: Create a java program to pre-sell the cinema ticket.The name of the program is TicketSeller.The maxi...

Q: I am getting stuck on the code to see if its a factor or not. Im not sure where I went wrong.

A: The following is the source code which prints whether a number is a factor of generated random numbe...

Q: Write a program that reads in a tax rate (in percentage) and the prices of three items from the keyb...

A: Program AlgorithmDeclare the required variables in the main().Get the input from user for tax rate, ...

Q: Explain how the minimum-sum descent problem can be solved by Dijkstra’s algorithm.    This is a prob...

A: The problem is to find the solution of minimum-sum descent  problem is relatively simple using Top-t...

Q: Write a program (IN C++) that will present the user with a main menu of options which the user can c...

A: Click to see the answer

Q: I need help programming this problem in C++   Given an array of N elements, what is the average numb...

A: Linear Search:Take the array of N number of elements. Best case:Assume, that the search element is a...

Q: What are the benefits of using a vector over an array?

A: Vector - It is a data structure used to store data.Vectors can be implemented as dynamic arrays with...

Q: Create class SavingsAccount. Use a static variable annualInterestRate to store the annual interest r...

A: The following source code will perform the functions as specified in the question.

Q: a. Construct a Huffman code for the following data: Symbol A L I Z P Frequency 4.5 .5 3.0 1.0 1...

A: a)Constructing Hauffman code for the given data:

Q: Many documents use a specific format for a person's name. Write a program whose input is: firstName ...

A: This program can be done in a very easy way. Programming instruction: First, take the input from the...

Q: Using C++ 11 Design a class called NumDays. The class’s purpose is to store a value that represents ...

A: Following is the c++ program:This keyword is used to refer to the current instance of class. The pro...

Q: I need help with a C program     /* Figure 6.2 */ /* Reads each number from an input file and wri...

A: Program://inlcude the required header files#include <stdio.h>#include <stdlib.h> //defin...

Q: Which of the following diagrams do not contradict the current state of our knowledge about the compl...

A: P class problems can be solved in deterministic polynomial time. NP class can be verified in the pol...

Q: First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ...

A: Program InstructionsFirst, click on the file and create a new project called “PatternMaker”.Then, cr...

Q: Given the information below, create the fully labeled Crow's Foot ERD using a specialization hierarc...

A: The fully labelled Crow's Foot ERD using a specialization hierarchy is given below. The ERD containU...

Q: Create a program that prompts the user for an amount less than 100 and then displays the minimum num...

A: Program AlgorithmInitialize the required variables.Get the input from the user and check if the inpu...

Q: Hi, I just finished the code for writing a java program that accepts ingredients for a recipe in cup...

A: Begin the pseudocode with the description/goal of the program.Indent loop and condition constructs p...

Q: What is the new risk management framework initiative? How is it superior to the previous approach fo...

A: The New risk management framework initiative:It is the NIST special publication 800-37, this is the ...

Q: Active Directory metadata describes the actual Active Directory data, not the Active Directory datab...

A: Active Directory:The Microsoft Technology used to manage computers and the other devices in a networ...

Q: Describe a cloud storage application and explain the advantages and disadvantages of such cloud stor...

A: Cloud storage:Cloud Storage is a service where data is remotely maintained, managed, and backed up. ...

Q: Write a simplified expression for the Boolean function defined by each of the following Kmaps.

A: a)Identify only 1’s in the kmap group.Find the largest group of 1’s, group can have either 2,4 or 8....

Q: Please explain, as simplistically (but thoroughly) as possible, how to develop a k-map from a truth ...

A: Rules to be followed to simplify the Boolean expression are given below-

Q: Using the data file capabilities of C++, create a Personnel file, personnel.dat on your drive and th...

A: Program Instructions:Use do-while loop to repeatedly present the menu.Use switch statement to opt di...

Q: I am working in eclipse to find 3 ingredients from user, how many cups per ingredient and then add t...

A: The java program obeys the following rubrics: -Importing the essential headers.In main method – Decl...

Q: Python 3.7.4: Assume that C is a variable has been assigned a string value. Write an expression whos...

A: Since you have not specified what needs to be done in else part so we have included a print statemen...

Q: Python 3.7.4 Write a for loop that prints in ascending order all the positive multiples of 5 that ar...

A: Using a for loop to print all the positive 5 multiples under 175 .For loop: It is programming langua...

Q: Create a GUI interface for a currency converter - Dollar-to-Euro. It should look something like the ...

A: To create a GUI converter that converts the currency from dollar to euro below is the approach and j...

Q: Write a Java program that prompts the user to enter an integer and reports whether the integer is a ...

A: Create a class with name Check_pal, and initialize a global variable number of class methods.Create ...

Q: Please explain how you solve the follwing problem:

A: Since you have posted multiple questions and have not specified which question needs to be solved, w...

Q: My prompt for my C++ problem is to write a program that accepts command line arguments and to print ...

A: Create a C++ program which will shows either true or false for first and last string character.Progr...

Q: What trade-offs are involved in building highly distributed data environments?

A: Trade-offs that are involved in building highly distributed data environments: 1) Availability,  2) ...

Q: Compare and contrast cache and virtual memory and give an example scenario where each can be applied...

A: Cache memory:-It is the memory, which is very nearest to the CPU, all recent instruction is stored i...

Q: Write a program in Python that calculates the area of a circle. Begin by assigning 3.1416 to a prope...

A: Create a PYTHON program that imports the "math" module and "const" module that we have created in an...

Q: Consider partitioning the list {1,4,0,1,1,1,2,3,1,0,4,4,1,2,0,1} where the first element ofthe array...

A: Program description for part (A)The program for part A works by using two new arrays for the left an...

Q: 4.7: Time Machine Your time machine is capable of going forward in time up to 24 hours. The machine ...

A: Program Instructions:Take the time in int variables and store extra symbols in the char extra.Pass t...

Q: Write a program that displays the income tax due on taxable income entered by the user. Have the use...

A: The program that displays the income tax due on taxable income is created in java.In calTax() method...

Q: Suppose you have two columns, [Text1] and [Text2], in a MS Access table, how do you enforcethat only...

A: Validation rule to have value in one column:[Text1] and [Text2] are the two columns in a MS access t...

Q: I am trying to write a java code to see if the number entered by the user is a factor of the random ...

A: The following source code will print whether a number is a factor of generated random number or not ...

Q: Security challenges of social networking sites

A: Security challenges of Social Network WebsitesSocial EngineeringIt involves techniques used by hacke...

Q: Suppose s is a string with the value "java". What will be assigned to x if you execute the following...

A: Given:String s = “java”;char x = s.charAt(4);

Q: Write an application starting with ProjectTemplate. Name the class AgeCalcApp. The app needs to prom...

A: To write an application name ProjectTemplate with the class name AgeCalcApp. This application prompt...

Q: Twin primes are two primes that differ by 2 (e.g., 3 and 5, 101 and 103). Write a ++ program that ou...

A: Program AlgorithmDeclare the required variables and an array of 1000 elements in main().Then use a f...

Q: Draw a decision tree and find the number of key comparisons in the worst and average cases for the t...

A: Decision tree (enhanced bubble sort):

Q: Write the code to assign the value 10 to an variable named a

A: The Java code is given below to assign the value 10 to a variable named ‘a’. There are two ways to a...

Q: During garbage collection, what setting controls how long deleted objects remain within the database...

A: The container object tombstone contains deleted objects from Active directory. An object that is del...