Open main menu

CDOT Wiki β

Changes

Rchan sandbox

149 bytes added, 16:28, 3 November 2019
Part 3 - Operator overloading
== Part 3 - Operator overloading ==
: Attached code to operator '+' and '-' to support the operation of adding two time object.
<source lang="python">
def __add__(self, t2):
seconds = self.time_to_sec() + t2.time_to_sec()
return sec_to_time(seconds)
</source>
= Investigation III - Objects and Scope =
1,760
edits