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

from datetime import datetime
class DateTime:
    def __init__(self ,year,month,day):
        self.year, self.month, self.day = year,month,day
    # @classmethod 
    # def One(cls,datetime):
    #     return cls(datetime.today())

    @classmethod
    def Two(cls,datetime):
        return cls(datetime.year,datetime.month,datetime.day)

bd = DateTime.Two(today)
print(bd.day)
print(bd.month)
print(bd.year)