We have a loud talking parrot. The hour
parameter is the current hour time in the range 0..23. We are in trouble if the parrot is talking and the hour is before 7 or after 20. Return True
if we are in trouble.
parrot_trouble(True, 6) → True
parrot_trouble(True, 7) → False
parrot_trouble(False, 6) → False
This is my code
def parrot_trouble(talking, hour):
if talking and hour < 7 or hour > 20:
return True
else:
return False
my code has solve most of the problems but these last two are not working please help!
parrot_trouble(False, 21) → False
parrot_trouble(False, 23) → False
Also if you have a more efficient code please do write it.