def display_menu(): print('The following operations are available:\n') print('1) Madlibs Haiku') print('2) Color Combination') print('3) BMI Calculator') print('4) Exit\n') def madlibs_haiku(noun, season, adjective, animal): print(noun + ' on water') print('The sound of ' + season) print(adjective + ' ' + animal) def color_combination(primary1, primary2): if primary1 == primary2: print('Error, please provide different colors') elif (primary1 == 'yellow' or primary2 == 'yellow') and (primary1 == 'blue' or primary2 == 'blue'): print('Green') elif (primary1 == 'red' or primary2 == 'red') and (primary1 == 'yellow' or primary2 == 'yellow'): print('Orange') elif (primary1 == 'red' or primary2 == 'red') and (primary1 == 'blue' or primary2 == 'blue'): print('purple') else: print('Error, one of your inputs was an invalid color') def compute_bmi(weight, height): BMI_OFFSET = 703 return (BMI_OFFSET * weight)/height**2 def assess_bmi(bmi): if bmi <= 18.5: return 'Underweight' elif bmi <= 24.99: return 'Normal Weight' elif bmi <= 29.99: return 'Overweight' elif bmi <= 34.99: return 'Obesity (Class 1)' elif bmi <= 39.99: return 'Obesity (Class 2)' else: return 'Morbid Obesity' def main(): display_menu() choice = int(input('What is your choice? ')) if choice == 1: noun = input('What is your noun? ') season = input('What is your season? ') adj = input('What is your adjective? ') animal = input('What is your animal? ') madlibs_haiku(noun, season, adj, animal) elif choice == 2: primary1 = input('what is your first color (red, yellow, or blue)? ') primary2 = input('what is your second color (red, yellow, or blue)? ') color_combination(primary1, primary2) elif choice == 3: height = float(input('What is your height? ')) weight = float(input('What is your weight? ')) bmi = compute_bmi(weight, height) print('Your BMI is: ' + str(bmi)) print('Your BMI classification is: ' + assess_bmi(bmi)) elif choice == 4: pass else: print('invalid choice') main()