# Yixuan Sun
# 9/20/2021
# I learn is sequence in python and how to fix it if there is an error
# the problem is need to think more how I solve it is try out functions and figure out where i did wrong.
# put the print after the def then it will work
# review and run code - note: fix error in the following "tasks" section
have_hat = hat_available('green')
# the hat is not define
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)
# fist need to run the code that define hat available then call hat available
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)
# I create a program with tell which bird is in the program
def bird_available(bird):
bird_types = 'crow, robin, parrot, eagle, sandpiper, hawk, piegon'
return bird.lower()in bird_types
bird_input = bird_available(input("type bird name here:"))
print("the bird is avaiable T/F: ", bird_input)
# the error is it did put definie so I put def infront of how many
def how_many():
requested = input("enter how many you want: ")
return requested
number_needed = how_many()
print(number_needed, "will be ordered")