Skip to content

Object-Oriented Programming in Python

Take Notes

Add notes about the concepts you've learned and code cells with code you want to keep.

Add your notes here

# Add your code snippets here

Recall that Python allows multiple variable assignments in one line

self.year, self.month, self.day = year, month, day
@classmethod
    def from_str(cls, datestr):
        year, month, day = map(int, datestr.split("-"))
        return cls(year, month, day)