# functions go here... def make_statement(statement, decoration, lines): """Creates headings (3 lines), subheadings (2 lines) and emphasised text / mini-headings (1 line). Only use emoji for single line statements""" middle = f"{decoration * 3} {statement} {decoration * 3}" top_bottom = decoration * len(middle) if lines == 1: print(middle) elif lines == 2: print(middle) print(top_bottom) else: print(top_bottom) print(middle) print(top_bottom) def yes_no(question): """Checks that users enter yes / y or no / n to a question""" while True: response = input(question).lower() if response == "yes" or response == "y": return "yes" elif response == "no" or response == "n": return "no" else: print("Please enter yes (y) or no (n).\n") # Main routine goes here want_instructions = yes_no("Do you want to read the instructions? ") if want_instructions == "yes" or want_instructions == "y": make_statement("Instructions", "=", 3) print() make_statement("Pick either area or perimeter, then choose your shape and input the sizes of the sides!", "-", 2) print() make_statement("The calculator will find the area or perimeter as well as showing you what equation it used", "!", 1) elif want_instructions == "no" or want_instructions == "n": print("you chose no") else: print("please enter yes or no")