Question: Define a class named Timer that represents an amount of time in hours and minutes. The class should have two integer attributes: hours and minutes.

Define a class named Timer that represents an amount of time in hours and minutes. The class should have two integer attributes: hours and minutes. The constructor should perform the following validation before assigning the values passed into the constructor:1) Check if both arguments (hours and minutes) are integers. If not, raise a ValueError.2) Check if both arguments (hours and minutes) are positive. If not, raise a ValueError.Check if the value of minutes is between 0 and 59. If not, raise a ValueError.Hint: The isinstance) function can help verify the variable type.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!