Question: Question 1 0 ( 1 point ) Saved The following code and traceback shows that our class Time's hour property validates the values you assign

Question 10(1 point)
Saved
The following code and traceback shows that our class Time's hour property validates the values you assign to it:
In [10]: wake_up.hour =100
---------------------------------------------------------------------
ValueError Traceback (most recent call last)
in ()
---->1 wake_up.hour =100
~/Documents/examples/ch10/timewithproperties.py in hour(self, hour)
20"""Set the hour."""
21 if not (0<= hour <24):
--->22 raise ValueError(f'Hour ({hour}) must be 0-23')
23
24 self._hour = hour
ValueError: Hour (100) must be 0-23
Which of the following statements a), b) or c) is false?
Question 10 options:
The value 100 is out of range so the code raises a ValueError.
The code attempts to set the hour property to an invalid value.
The code checks that the hour property is in the range 0 through 24.
All of the above statements are true.

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!