Skip to content

Instantly share code, notes, and snippets.

@ks--ks
Created July 3, 2020 22:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ks--ks/f3060f511873944728cf2855147377e2 to your computer and use it in GitHub Desktop.
A quick Python exercise
#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))
@AlinaMuraretu
Copy link

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