# lambda functions page 43 # function for calculating total amount def totalamount(subtotal, taxpercentage): # pass # Using the lambda keyword create the lambda expression calculatedtotal = lambda subtotal, taxpercentage : subtotal + (subtotal * taxpercentage) # 107.0 assertion testing # call the lambda function from INSIDE totalamount() total = calculatedtotal(subtotal, taxpercentage) return total # static value to program def main(): subtotal = int( input("Enter subtotal: ")) taxpercentage = float( input("Enter tax percentage: (.07 for 7%) ")) newtotal = totalamount(subtotal, taxpercentage) # newtotal var name data type float assigning 107.0 print(newtotal) # 107.0 if __name__ == "__main__": main() # EOF mycart.py