# review and run code - note: fix error in the following "tasks" section
have_hat = hat_available('green')
print('hat available is', have_hat)
def hat_available(color):
hat_colors = 'black, red, blue, green, white, grey, brown, pink'
# return Boolean
return(color.lower() in hat_colors)
# [ ] fix the sequence of the code to remove the NameError
def hat_available(color):
hat_colors = 'black, red, blue, green, white, grey, brown, pink'
return(color.lower() in hat_colors)
have_hat = hat_available('green')
print('hat available is', have_hat)
# [ ] create function bird_available
bird_types = "crow robin parrot eagle sandpiper hawk pigeon"
def bird_available(bird):
print("Bird availability for", bird,"=", bird in bird_types)
bird_available(input("What bird are you looking for?").lower())
# [ ] user input
# [ ] call bird_available
# [ ] print availbility status
def how_many():
"""
Ask user how many they want.
args:
none
returns:
requested: number user wants
"""
requested = input("enter how many you want: ")
return requested
# get the number_needed
number_needed = how_many()
print(number_needed, "will be ordered")