Week 6 - Introduction to Object-Oriented Programming
My Lectures
I'm not going to lie... I just didn't have the time to re-record these videos for this semester. For the most part it isn't a big deal. BUT, you will see me using the IDE called "IDLE" that comes with Python by default rather than Thonny like we have been using. There really truly is no significant difference in behavior. The only difference is that IDLE separates the code window from the shell window while Thonny bundles them together into one interface. This shouldn't confuse you now that you understand.
- Motivating OO Programming (4 minutes)
- What is OO Programming? (22 minutes)
- Getting started with Classes in Python (17 minutes)
- Looking at Code for a Wallet filled with Credit Cards (4 minutes)
- Magic Methods and the Fraction Class (8 minutes)
- Fixing the Fraction Class - OOPS (2 minutes)
- The bottom line (3 minutes)
Materials
The following materials were used/distributed during the session.
- PowerPoint Slides
- Code
- Credit Card
- Wallet (used to "run" credit card)
- Fraction
- Fixed Fraction after we found an error during video recording
- Magic Methods Handout
Reading Guide
- Read pp 306-316 in your textbook.
- For this course we are most interested in the material on OOP on pp 315-316
- Having said that, the material on 306-314 is stuff that you should read in the big picture of things.
- Read pp 350-356
Additional Videos
I will admit that the following aren't perfect. But I think there is something to learn from them anyways.
- Object Oriented Programming in 7 minutes video (you may want to turn on the closed captioning).
- Once you are done with the video I propose reading How to Explain OOP to a 6 year old.