Lecture 30: Lists of Lists

Slides:



Advertisements
Similar presentations
Copyright 2010 by Pearson Education Building Java Programs Chapter 7 Lecture 7-2: Arrays as Parameters reading: , 3.3 self-checks: Ch. 7 #5, 8,
Advertisements

2x2 module & stave layouts. 2 options “Small chip” “Big chip” Boundary between “small” and “big” is determined by the 6” sensor wafer layout that must.
Page margin margin for header and footer. page size page orientation.
Section 1.6 Frequency Distributions and Histograms.
Exercise Exercise3.1 8 Exercise3.1 9 Exercise
Exercise Exercise Exercise Exercise
Exercise Exercise Exercise Exercise
Lecture 11 Tuesday, 23 June ENGINEERING GRAPHICS 1E7 Lecture 11: Auxiliary Views.
Exercise Exercise6.1 7 Exercise6.1 8 Exercise6.1 9.
Graph Implementations Chapter 29 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
INTRODUCTION TO PYTHON PART 5 - GRAPHICS CSC482 Introduction to Text Analytics Thomas Tiahrt, MA, PhD.
What is a Mountain?  “A natural elevation of the earth’s surface rising more or less abruptly to a summit”  Fun Fact: Sutter Buttes = smallest mountain.
How to create tables in HTML…
COMPSCI 101 Principles of Programming Lecture 27 - Using the Canvas widget to draw rows and columns of shapes.
Using Similar Figures to Solve Problems. There are a variety of problems that can be solved with similar triangles. To make things easier use or draw.
Copyright © 2010 McGraw-Hill Ryerson Limited, a Subsidiary of The McGraw-Hill Companies. All rights reserved. Solving Right Triangles Section 3.3.
QBM117 Business Statistics Probability and Probability Distributions Continuous Probability Distributions 1.
Exploring the Earth’s Surface Landforms
Exploring Earth’s Surface
Graphics Concepts CS 2302, Fall /3/20142 Drawing Paths.
Areas involving rectangles and triangles For each rectangle you must be able to spot the length and width For each triangle you must be able to spot the.
EXPLORING EARTH’S SURFACE Keith D. Church, Ph.D..
Ch2 Sec1 Exploring Earth’s Surface. Key Concepts What does the topography of an area include? What are the main types of landforms? Key Terms – Topography.
How to create a table in Blackboard?
Creating and Managing Content Types Module 9. Overview  Understanding Content Types  Creating and Using Site Columns  Creating and Using Site Content.
Conditionals-part21 Conditionals – part 2 Barb Ericson Georgia Institute of Technology Nov 2009.
Mapping Earth’s Surface Chapter 1, Lesson 1. The difference in elevation between the highest and lowest parts of an area. relief.
1/25/2016B.Ramamurthy1 Exam3 Review CSE111 B.Ramamurthy.
1 Chapter 04: Working with Table By Tharith Sriv.
Adapted from  2012 Prentice Hall, Inc. All rights reserved. 5 th ed: th ed: SY306 Web and Databases for Cyber Operations Set 2:
An identifiable path of a point moving in space. It can vary in width, direction, and length.
Excel Introduction to computers. Excel 2007 Starting the Excel program.
Lesson 5-4 Example Example 1 Draw an array to model and find 21 ÷ 3. 1.Write the answer if you know it. Otherwise, draw an array.
$200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200.
Maps. What do we need in order to read a map? Direction Scale Legend.
Adapted from slides by Marty Stepp and Stuart Reges
Adapted from slides by Marty Stepp and Stuart Reges
Approximating Euler Paths
CSc 110, Autumn 2017 Lecture 23: lists as Parameters
CSc 110, Spring 2017 Lecture 28: Sets and Dictionaries
CSc 110, Spring 2017 Lecture 6: Parameters (cont.) and Graphics
Lecture 7: Graphics, return values and math
LANDFORMS VIDEO youtube. com/watch
Exercise 39 - Skills A table on your Web page provides one of the best ways to organize and align graphics, text and other objects on the page. You can.
CSc 110, Spring 2018 Lecture 9: Parameters, Graphics and Random
CSc 110, Autumn 2016 Lecture 19: lists as Parameters
Mapping Earth’s Surface
CSc 110, Autumn 2017 Lecture 9: Graphics and Nested Loops
ENGN103 Engineering Drawing
Lecture 26: Lists of Lists
Adapted from slides by Marty Stepp and Stuart Reges
CSc 110, Spring 2018 Lecture 23: lists as Parameters
Cut Hexagonal Prism Cut Hexagonal Prism - Question
Principles of Programming Languages
ENGN103 Engineering Drawing
CSc 110, Spring 2018 Lecture 10: More Graphics
2 types of scale factor problems
Lesson 2 - Multi-Dimensional References
CSc 110, Autumn 2017 Lecture 8: More Graphics
Practice Activity – Part 1
ENGN103 Engineering Drawing orthographic projections
Lecture 29: Lists of Lists
ENGN103 Engineering Drawing orthographic projections
ENGN103 Engineering Drawing
ENGN103 Engineering Drawing orthographic projections
Lecture 24: Lists of Lists
Algorithms CSCI 235, Spring 2019 Lecture 8 Recurrences III
Changing the Appearance of a Worksheet
Lecture 11: return values and math
EECE.2160 ECE Application Programming
Presentation transcript:

Lecture 30: Lists of Lists CSc 110, Spring 2018 Lecture 30: Lists of Lists

Exercise Write a function called flip that takes a list of lists and two columns and swaps their contents. For example if flip(data, 2, 3) were called on the following list data = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] data would contain the following afterwards: data = [[1, 3, 2], [4, 6, 5], [7, 9, 8]]

Exercise Write a function called create_matrix that takes a width and a height as parameters and returns a list of lists that is width by height and contains the numbers 0 to width - 1 in each row. For example a call to create_matrix(5, 3) would return the following list of lists: [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4]]

Creating Lists of lists list = [[0] * 4] * 5 will NOT create a list of lists This will create a list with 5 spots that all contain the SAME list that is 4 long. Instead, write the following: list = [] for i in range(0, 5): list.append([0] * 4)

Mountain peak Write a program that reads elevation data from a file, draws it on a DrawingPanel and finds the path from the highest elevation to the edge of the region. Data: 34 76 87 9 34 8 22 33 33 33 45 65 43 22 5 7 88 0 56 76 76 77 4 45 55 55 4 5 …