1,760
edits
Changes
→Part 1 - Simple Object Class with external functions
== Part 1 - Simple Object Class with external functions ==
In this part, we consider a time object which has three data attributes, namely: hour, minute, and second. The following Python script '''lab7a.py''' provides the blue print for building such a time object and also defines three external functions that : format_time(), sum_times(), and valid_time(), which can manipulate the time object.
<source lang="python">
#!/usr/bin/env python3