Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.67 KB

CODE3.md

File metadata and controls

50 lines (34 loc) · 1.67 KB


At a glance... | Syllabus | Models | Code | Lecturer

Code3: coding homework

What to Hand in

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.

Instructions

Read chapters one to four of Think like a Computer Scientist

    1. Lists
    1. Dictionaries
    1. Tuples
    1. Classes and Objects
    1. Classes and Functions
    1. Classes and Methods
    1. 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__)
  • 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.