def is_even(value: int) -> bool:
"""Return True if and only if value is an even number.
>>> is_even(108)
True
>>> is_even(135)
False
"""
def convert_time(hour: int) -> int:
"""Return the given time in hours hour from the 24 hour clock
to
a time in hours for the 12 hour clock.
Precondition: 0 <= hour <= 23
>>> convert_time(0)
12
>>> convert_time(4)
4
>>> convert_time(15)
3
"""
# function to return true if number is even def is_even(num): # if number is even we return true if num % 2 == 0: return True # else we return false return False # function to convert hours in 24 hour clock to 12 hours clock def convert_time(hour): # check if hours are 0 or 12 if hour == 0 or hour == 12: return 12 # if hours are greater than 12 elif hour > 12: return hour - 12 # else hours are less than 12 else: return hour
output:
FOR HELP PLEASE COMMENT
THANK YOU
Get Answers For Free
Most questions answered within 1 hours.