Changes

Jump to: navigation, search

Rchan sandbox

105 bytes added, 19:48, 3 November 2019
Part 1 - Classes and Methods for our Time objects
:3. Please study the output of the interactive shell session above and note that in order to call the format_time() function, we have to prefix it with the class name '''Time''' as it is under the class definition in lab7d.py. Also note that format_time() is now a method of the time object '''t1'''.
:4. You may also notice that when we called the print() function with our time object t1, the print function only showed that it is an Time object and its memory location, but did not display its properties (i.e. data attributes) like the values of its hour, minute, and second attributes.
:5. Try to find out how to test the valid_date(), change_time() functions to make sure they all work.
:6
== Part 2 - Special object methods ==
1,760
edits

Navigation menu