Class 12 – Monday, February 10

A dataset by any other name is still a dataset (but it is not a set)

In a loop, a loop — Nesting, but not like a bird — Repeating again


Look both ways


Agenda


For the fun of it


To do list


Downloads


Datasets


Program dataset_intro.py

Program run

table: [['A', 'B', 'C'], ['D', 'E', 'F'], ['G', 'H', 'I'], ['J', 'K', 'L', 'M']]

the table has 4 rows

row ['A', 'B', 'C'] has 3 columns

row ['D', 'E', 'F'] has 3 columns

row ['G', 'H', 'I'] has 3 columns

row ['J', 'K', 'L', 'M'] has 4 columns

row 0 : ['A', 'B', 'C']

row 1 : ['D', 'E', 'F']

row 2 : ['G', 'H', 'I']

row 3 : ['J', 'K', 'L', 'M']

row 0 : ['A', 'B', 'C']

  column 0 of row 0 : A

  column 1 of row 0 : B

  column 2 of row 0 : C

row 1 : ['D', 'E', 'F']

  column 0 of row 1 : D

  column 1 of row 1 : E

  column 2 of row 1 : F

row 2 : ['G', 'H', 'I']

  column 0 of row 2 : G

  column 1 of row 2 : H

  column 2 of row 2 : I

row 3 : ['J', 'K', 'L', 'M']

  column 0 of row 3 : J

  column 1 of row 3 : K

  column 2 of row 3 : L

  column 3 of row 3 : M

A B C

D E F

G H I

J K L M



Program lotta_books.py

Program run

['Name', 'Author', 'Language', 'Date', 'Sales']

['Don Quixote', 'de Cervantes', 'Spanish', 1605, 500000000]

['A Tale of Two Cities', 'Dickens', 'English', 1859, 200000000]

['The Lord of the Rings', 'Tolkien', 'English', 1954, 150000000]

['The Little Prince', 'de Saint-Exupery', 'French', 1943, 140000000]

['Harry Potter', 'Rowling', 'English', 1997, 120000000]

['The Hobbit', 'Tolkien', 'English', 1937, 100000000]

['And Then There Were None', 'Christie', 'English', 1939, 100000000]

['Dream of the Red Chamber', 'Xueqin', 'Chinese', 1754, 100000000]

["Alice's Adventures in Wonderland", 'Carroll', 'English', 1865, 100000000]

sales column: 4

Total sold: 1.51 billion




Kingda Ka tower

 


 
  © 2020 Jim Cohoon   Resources from previous semesters are available.