Open main menu

CDOT Wiki β

Changes

Rchan sandbox

6 bytes added, 00:48, 3 November 2019
Part 3 - Another approach to perform operation on time objects
tsum1 = sum_times(t1,td)
tsum2 = sum_times(t2,td)
tsum3 t3None = sum_timeschange_time(t3,td1800)
ft = format_time
print(ft(t1),'+',ft(td),'-->',ft(tsum1))
print(ft(t2),'+',ft(td),'-->',ft(tsum2))
print(ft(t3),'09:50:00 +1800 sec',ft(td),'-->',ft(tsum3t3))
</source>
:7. Test run your script '''lab7c1.py''', it should produce the following output:<source lang="bash">
08:00:00 + 00:50:00 --> 08:50:00
08:55:00 + 00:50:00 --> 09:45:00
09:50:00 + 00:50:00 1800 sec --> 10:4020:00
</source>
:8. Download the checking script and check your work. Enter the following commands from the bash shell.<source lang="bash">
1,760
edits