Changes

Jump to: navigation, search

OPS445 Online Lab7

9 bytes added, 10:54, 10 July 2023
Part 2 - Special object methods: fix typo
def __str__(self):
'''return a string representation for the object self'''
return f'{tself.hour:02}:{tself.minute:02}:{tself.second:02}'
</source>
:1. Make a copy of lab7d.py and name it as lab7e.py. Add the function definition for __str__() after the __init__() function in lab7e.py. Make sure that the '''def __str__(self):''' line has the same indentation level as the __init__() function.

Navigation menu