# myfunctions.py import cart def modifiedSalesTax(): state = "FL" if state == "FL": print("No Sales Tax") # python core NO import else: cart.salesTaxCalc() # imported in myfunctions def myHeader(): appTitle = "My Application Title" # page 43 variable scope print(appTitle) print("--------------------") def mainMenu(): print("------ Menu --------") print("1. Contacts") print("2. Products") print("3. Orders") def myFooter(emailAdd="philipm@onlc.com"): # define # page 42 helper method # query string parameter print("--- Footer ------") #emailAddress = emailAdd # myFooter("philipm@onlc.com") passing value when called print("Email Address:", emailAdd) print("Web Site: https://philipmatusiak.com") def myHeaderMenuCombined(): myHeader() mainMenu() # Lambda Functions page 43 # name = lambda params: expression or operation # expression full_name = lambda first_name, last_name: f"Contact Full Name: {first_name} {last_name}" # operation cart_Total = lambda subTotal, salesTax, discount : subTotal + salesTax - discount # DateTime page 67 from datetime import datetime # from Module import Class # datetime stamp now() orderTimestamp = datetime.now() # datetime timedelta to calculate a date range def invoiceAging(): from datetime import timedelta # Get the current date current_date = datetime.now() due_date = datetime(2023, 11, 1) # "11/01/2023" string # subtract the current date from the due date PAST DUE aging = current_date - due_date #timdelta difference # Extract from timedelta "days" aging_days = aging.days print("Past due:", aging_days) # 35