At a glance... |
Syllabus |
Models |
Code |
Lecturer
After doing all the following, you should
be able to write one source files into hw/code/3
along with
screen snaps of your work.
Using some URL shortener (e.g. goo.gl), shorten the URL to hw/code/3
and paste into the submission page.
Read chapters one to four of Think like a Computer Scientist
-
- Lists
-
- Dictionaries
-
- Tuples
-
- Classes and Objects
-
- Classes and Functions
-
- Classes and Methods
-
- Inheritance
Read about Python's magic methods
Then do:
- 10.15 Exercise 8 (the Birthday Paradox)
- Write an
Employeee
class- That can be initialized with name and age (hint:
__init__
) - That pretty prints name and age (hint:
__repr__
) - That can be sorted on age (hint:
__lt__
)
- That can be initialized with name and age (hint:
- 18.12:Exercise 6 (Poker!)
Copyright © 2015 Tim Menzies.
This is free and unencumbered software released into the public domain.
For more details, see the license.