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: Check if both arguments hours and minutes are integers. If not, raise a ValueError Check if both arguments hours and minutes are positive. If not, raise a ValueError.Check if the value of minutes is between and 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
