Open main menu

CDOT Wiki β

Changes

Rchan sandbox

18 bytes added, 17:18, 2 November 2019
Part 1 - Simple Object Class with external functions
:6 To fix that problem, perform the following:
::(a) Edit the file '''lab7a.py''' and modify the function sum_times(). Add code to check the values of the time object's three attributes. If the value of the minute attribute is more than 60, carry it over to the hour until it is less than 60. Do the same for the value of the second attribute.
::(b) The follow illustration below indicates where you should perform the carry over operation in the sum_times() function in '''lab7a.py''':<source lang="python">
...
...
</source>
::(c) Save the file.
::(d) Test run your script '''lab7a1.py''' again and make sure that it produces the output that matches to match the following exactly:<source lang="bash">
[rchan@centos7 lab7]$ python3 lab7a1.py
08:00:00 + 00:50:00 --> 08:50:00
1,760
edits