What This Document Is
These are lecture notes from Emory University’s Introduction to Computer Science I (CS 170) covering the foundational concept of classes and objects in Python programming – specifically, Chapter 15 of the course textbook. The notes introduce object-oriented programming as a method for organizing code and data using programmer-defined types. It builds upon prior knowledge of functions and built-in data types.
Why This Document Matters
This document is essential for students in CS 170 who are beginning to explore object-oriented programming. It serves as a companion to the textbook chapter, providing a focused overview of key concepts. Understanding classes and objects is crucial for writing more complex, organized, and reusable code, and forms a core principle in modern software development. These notes are most useful when reviewed *before* or *during* independent coding practice.
Common Limitations or Challenges
These notes provide an *introduction* to classes and objects. They do not offer comprehensive coding exercises or solutions. Students will still need to work through the textbook examples and complete assigned programming projects to fully grasp the concepts. This preview does not cover advanced topics like inheritance or polymorphism, which are addressed in subsequent chapters.
What This Document Provides
This document includes:
* An explanation of programmer-defined types (classes) as an alternative to built-in Python types.
* A demonstration of how to define a simple class (Point) to represent two-dimensional coordinates.
* An introduction to the concept of *instantiation* – creating objects from a class.
* An explanation of *attributes* – the data associated with an object.
* Examples of how to access and use attributes using dot notation.
* A visual representation of objects and their attributes using a state diagram (object diagram).