Created
July 3, 2020 22:41
Star
You must be signed in to star a gist
A quick Python exercise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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. | |
def parrot_trouble(talking, hour): | |
#hour < 7 or hour > 20 | |
return (talking and (hour - 7 or hour > 20)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
def parrot_trouble(talking, hour):
#hour < 7 or hour > 20
return (talking and (hour - 7 or hour > 20))