Question: Using python code, use the Time class described in the picture. As part of the Time class include a method that adds one Time object
Using python code, use the Time class described in the picture. As part of the Time class include a method that adds one Time object to another; the method should be defined with the parameter for the other Time object. You also need to define a mainscript that creates instances of the Time class, meaning you need to assign values to each Time object and then call the add() method [ie. time_object1.add(time_object2) ] , you also need to call the print_time() method on both objects before and after the call to the add() method.

class Time: def init (self): self.hours = 0 self.minutes = 0 def print_time(self) print( 'Hours:', self.hours, end" print( 'Minutes:', self.minutes)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
