Without functions all we have are attributes of objects. Functions are where variables live. This extract from Programmer's Python: Everything is an Object explains that functions bring something new ...
def set_time(self, hour=0, minute=0, second=0, millisecond=0): if not (0 <= hour < 24): raise ValueError(f'Hour ({hour}) must be 0-23') self.hour = hour if not (0 ...