import pandas # Functions go here def make_statement(statement, decoration, lines=1): """Creates headings (3 lines), subheadings (2lines) 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 currency(x): """Formats numbers as currency ($#, ##)""" return "${:.2f}".format(x) # pizza lists pizza_types = ["Cheese", "Peperoni", "Ham & Cheese", "BBQ", "Veggie", "Meat-lovers", "Spicy chicken", "Pesto", "Hawaiian", "Burger"] special_pizzas = ["Dessert Pizza", "Butter Chicken"] pizza_cost = [6.50] * 10 special_price = [6.50, 6.75] # Create dictionaries pizza_dict = { 'Pizza': pizza_types, 'Price': pizza_cost, } special_dict = { 'Special Pizza': special_pizzas, 'Price': special_price, } # Create dataframes pizza_palace_frame = pandas.DataFrame(pizza_dict) pizza_palace_frame.index = pizza_palace_frame.index + 1 special_frame = pandas.DataFrame(special_dict) special_frame.index = special_frame.index + 11 # Apply currency formatting pizza_palace_frame['Price'] = pizza_palace_frame['Price'].apply(currency) special_frame['Price'] = special_frame['Price'].apply(currency) # Main routine make_statement(statement="Pizza Palace", decoration="🍕") print(pizza_palace_frame) make_statement(statement="", decoration="----") print(special_frame)