Course 3: The Power of Abstraction
This course taught me how to avoid repetition in my code by defining 'Classes' of 'Objects' with similar properties. This 'Object-Oriented' style of programming also lets me think about programs in a way that I'm familiar with
Lesson 1: Use Functions
A review of functions in Python.
-
Computer: A computer is a machine that can carry out instructions given to it by a programmer.
-
Grammar: Grammar refers to the rules that govern what statements are 'legal' in a language. Python has it's own grammar.
Lesson 2: Use Classes - Draw Turtles
Learn how to use Python 'classes' which other programmers have already written.
-
Variable: A variable is a titled container that holds information.
-
String: A string is just text. We create strings by using single or double quotes.
Lesson 3: Use Classes - Send Text
Use 'Twillio' to send text messages to people with code!
-
External Libraries: An 'external library' is just a library that someone has written that does not come packaged with Python (Twillio is an example).
-
from __ import __: When you write something like 'from twillio.rest import TwilioRestClient', you gain access to TwilioRestClient without having to import all the extra stuff that is in twillio.rest.
Lesson 4: Use Classes - Profanity Editor
Learn about how to work with files while making a profanity editor.
-
Reading Documentation: Since there are SO many tools out there for programmers to use, a big part of programming is finding and learning how to use the right ones. Reading the documentation for the tools you use is VERY important.
-
Built-in Functions: Python has a lot of built-in functions. These functions usually do something that is widely useful to many people. My favorite built-in function is 'enumerate'.
Lesson 5: Make Classes - Movie Website
Learn how to make your own Python 'classes' and build a website that displays movie information.
-
Class vs Instance: A 'Class' is like a blueprint for a building while an 'instance' is like an ACTUAL building that was made from the blueprint.
-
Instance Methods: Instance methods are special functions that belong to an 'instance' of a 'class.' They usually get or set information about the instance they are attached to.
Lesson 6: Make Classes - Advanced Topics
Learn about topics like Class methods, Inheritance, and Method Overriding.
-
Inheritance: When you use inheritance, you figure out what seemingly different things have in common and then capture that commonality in a 'parent' class.
-
Inheritance Example: In this lesson, we realized that instances of the TvShow class have a lot in common with instances of the Movie class. We put the common elements into a new Video class and had Movie and TvShow inherit from Video.