Previous Lecture | Lecture 9 | Next Lecture |
Lecture 9, Tue 08/28
Base conversion
Code from class
https://github.com/ucsb-cs8-m18/code-from-class/tree/master/08-28
Number conversions: http://www.robotroom.com/NumberSystems3.html https://ucsb-cs8.github.io/topics/number_conversions/
lots of grades are up
returning “True” vs. returning True Names that have spaces, and finding them in the command line Remember where you are saving things
lab 5 is time-consuming, so start early
iClicker Questions
0. Convert the decimal number 212 to base 16.
(a) D4
(b) C7
(c) F8
(d) EE
1. Now convert the decimal number 212 to binary.
(a) 11010111
(b) 10010100
(c) 11010110
(d) 11010100
In-Class Questions / Schedule of Events
- better files example (appending, writing, reading)
- binary (base 2), octal (base 8), hex (base 16), and how to convert (start by noticing how to get the digits of a decimal number)
- exceptions (see Python docs)
- dictionaries - key/value
- nickname example