Starting Out with Python (4th Edition)
4th Edition
ISBN: 9780134444321
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 7.8, Problem 19CP
Program Plan Intro
Two-dimensional list:
- • A list that has another list as its elements is called as two-dimensional list.
- • Two-dimensional list is a type of nested list, where elements are arranged in row and column order.
- • The element in the list is retrieved using two subscripts. One subscript specifies the row and the other subscript specifies the column.
- • The two-dimensional lists are helpful in processing various sets of information.
Syntax:
In Python, two-dimensional lists have the below format:
List_name = [list1,list2, …, listn]
Explanation:
Here,
- • The variable “List_name” is a two-dimensional list.
- • The variables “list1”, “list2”, and “listn” are elements of two-dimensional list “List_name” that indicates one-dimensional lists.
Example:
Consider the following example that shows a two-dimensional list.
student_scores = [[45, 63, 72], [81, 58, 97], [100, 23, 67]]
Explanation:
In the given above code,
- • The variable “student_scores” is a two-dimensional list that stores the students’ scores at various exams.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Given a nested list named NxN_table that represents a table with N rows and N columns, print each element that is along the diagonal of the table starting from the upper left corner moving down to the lower right corner.
Hint: You only need to use one loop. Draw a nested list that has three sublists each containing 3 elements.
What are the indexes of the elements along the diagonal?
Look at the following interactive session, in which a two-dimensional list is created. How many rows and how many columns are in the list? numbers = [[1, 2], [10, 20], [100, 200], [1000, 2000]]
A list contains elements is false in python.
True or false?
Chapter 7 Solutions
Starting Out with Python (4th Edition)
Ch. 7.2 - What will the following code display? numbers =...Ch. 7.2 - Prob. 2CPCh. 7.2 - Prob. 3CPCh. 7.2 - Prob. 4CPCh. 7.2 - Prob. 5CPCh. 7.2 - Prob. 6CPCh. 7.2 - Prob. 7CPCh. 7.2 - Prob. 8CPCh. 7.3 - Prob. 9CPCh. 7.3 - Prob. 10CP
Ch. 7.3 - Prob. 11CPCh. 7.3 - Prob. 12CPCh. 7.3 - Prob. 13CPCh. 7.4 - What will the following code display? names =...Ch. 7.5 - Prob. 15CPCh. 7.5 - Prob. 16CPCh. 7.5 - Prob. 17CPCh. 7.5 - Prob. 18CPCh. 7.8 - Prob. 19CPCh. 7.8 - Prob. 20CPCh. 7.8 - Write a set of nested loops that display the...Ch. 7.9 - Prob. 22CPCh. 7.9 - Prob. 23CPCh. 7.9 - Prob. 24CPCh. 7.9 - Prob. 25CPCh. 7.10 - Prob. 26CPCh. 7.10 - Prob. 27CPCh. 7.10 - Prob. 28CPCh. 7.10 - Prob. 29CPCh. 7.10 - Prob. 30CPCh. 7.10 - To create a bar chart with the bar function, what...Ch. 7.10 - Assume the following statement calls the bar...Ch. 7.10 - Prob. 33CPCh. 7 - This term refers to an individual item in a list....Ch. 7 - This is a number that identifies an item in a...Ch. 7 - Prob. 3MCCh. 7 - This is the last index in a list. a. 1 b. 99 c. 0...Ch. 7 - This will happen if you try to use an index that...Ch. 7 - This function returns the length of a list. a....Ch. 7 - When the operator's left operand is a list and...Ch. 7 - This list method adds an item to the end of an...Ch. 7 - This removes an item at a specific index in a...Ch. 7 - Prob. 10MCCh. 7 - If you call the index method to locate an item in...Ch. 7 - Prob. 12MCCh. 7 - This file object method returns a list containing...Ch. 7 - Which of the following statement creates a tuple?...Ch. 7 - Prob. 1TFCh. 7 - Prob. 2TFCh. 7 - Prob. 3TFCh. 7 - Prob. 4TFCh. 7 - A file object's writelines method automatically...Ch. 7 - You can use the + operator to concatenate two...Ch. 7 - Prob. 7TFCh. 7 - You can remove an element from a tuple by calling...Ch. 7 - Prob. 1SACh. 7 - Prob. 2SACh. 7 - What will the following code display? values = [2,...Ch. 7 - Prob. 4SACh. 7 - Prob. 5SACh. 7 - Prob. 6SACh. 7 - Prob. 1AWCh. 7 - Prob. 2AWCh. 7 - Prob. 3AWCh. 7 - Prob. 4AWCh. 7 - Write a function that accepts a list as an...Ch. 7 - Prob. 6AWCh. 7 - Prob. 7AWCh. 7 - Prob. 8AWCh. 7 - Total Sales Design a program that asks the user to...Ch. 7 - Prob. 2PECh. 7 - Rainfall Statistics Design a program that lets the...Ch. 7 - Prob. 4PECh. 7 - Prob. 5PECh. 7 - Larger Than n In a program, write a function that...Ch. 7 - Drivers License Exam The local driver s license...Ch. 7 - Name Search If you have downloaded the source code...Ch. 7 - Prob. 9PECh. 7 - World Series Champions If you have downloaded the...Ch. 7 - Prob. 11PECh. 7 - Prob. 12PECh. 7 - Magic 8 Ball Write a program that simulates a...Ch. 7 - Expense Pie Chart Create a text file that contains...Ch. 7 - 1994 Weekly Gas Graph In the student sample...
Knowledge Booster
Similar questions
- In the linked list below, find the value of "TEMP->Next->Data". list1 a. David b. Leah c. Robert d. Miriamarrow_forwardSuppose a list named listExample has six letters, length of listExample is :arrow_forwardto create a SortedList object with three names and IP addresses, show the code.arrow_forward
- Lists can contain elements of any type in Python. True or false?arrow_forwardthis is for pythonarrow_forwardTake a look at the interactive session below, in which a two-dimensional list is generated. How many rows and columns are there in the list?[[1, 2], [[10, 20], [100, 200], [1000, 2000]]arrow_forward
- Three strings are read from input and stored in the list zoo_animals. Then, three more strings are read from input and stored in the list added_animals. Create a new list called updated_animals that contains the elements of zoo_animals and added_animals, in that order.arrow_forwardComputer Science Client Number Address Zipcode 123 ABC 11111 124 ABD 11112 125 ABE 11114 126 ABF 11115 I have been able to export the file to python and convert it to dataframe. DataFrama being "df". How can I write an argument, where if a Zipcode is outside of a list [11111,11112,11113,11114] then it is a red flag. Thank you!arrow_forwardWhich operation below is not part of the List interface? add an element to the list remove an element from the list replace an element in the list with another element get the size of the list grow the size of the listarrow_forward
- I was tasked to write java linked lists but im new to it can someone help? here is the problem description Create a Linked List to store 5 movies names Create a method to print the linked list Create a method to search for a movie Print the last node of the linked listarrow_forwardI need it python languagearrow_forwardYou are writing an application. You need a data structure that will allow you to insert new elements. In addition, you must sometimes remove the maximum element and other times simply report the value of the maximum element. The client wants the program to be as efficient as possible. Which of the following data structures should you use in your design? Question 24 options: Unsorted linked list Hash table Array Sorted linked list Heaparrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education