Welcome to Lecture 7:
Nested Lists + Number Representation
Class will start at 10:10.
In the meantime, we will go around. Tell me your name, where you’re from, & favorite mythical creature.
Today’s Topics
Announcements
Review from Last Lecture
So far with lists, …
So far with lists, …
Why use Nested Lists?
Representing a Board
Representing X, Y Coordinates
Guess that Output!
Guess that Output!
Why use Nested Lists?
Representing a Board
Representing X, Y Coordinates
Guess that Output!
Guess that Output!
Accessing Elements + Lengths
Guess that Output!
Guess that Output!
Guess that Output!
Guess that Output!
Accessing Columns
Accessing Columns
Buggy Code. What went wrong?
Accessing Row, Columns with Loops!
Code that Function!
Code that Function!
Code that Function!
Code that Function!
Code that Function!
Code that Function!
Code that Function!
Code that Function!
Code that Function!
Code that Function!
Number Representation: Decimal
Number Representation: Base 8
Number Representation: Binary
Number Representation: Binary
32 | 16 | 8 | 4 | 2 | 1 |
| | | | | |
| 1 | | | | |
Number Representation: Binary
32 | 16 | 8 | 4 | 2 | 1 |
| 1 | 1 | 0 | 0 | 1 |
16 + 8 + 1 = 25 | |||||
Number Representation: Hexadecimal
Number Representation: Hexadecimal
Division | Equals | Whole # | Remainder |
574 / 16 | 35.875 | 35 | 14 |
35 / 16 | 2.1875 | 2 | 3 |
2 / 16 | 0.125 | 0 | 2 |
Number Representation: Hexadecimal
Remainder |
14 = E |
3 |
2 |
MSD
LSD
Number Representation: Operations
Division | Equals | Whole # | Remainder |
249 / 8 | 31.125 | 31 | 1 |
31 / 8 | 3.875 | 3 | 7 |
3 / 8 | 0.375 | 0 | 3 |