For this activity, you may work alone or with one partner. Do the following problems and write function(s) to solve the problems. Be sure to include docstrings describing what the function does.
Write a file (named awesomeshirtshop.py) with two functions:
custom_shirt and get_total_order.
import awesomeshirtshop awesomeshirtshop.custom_shirt("M", "I'm awesome", "back") awesomeshirtshop.custom_shirt("M", "I'm awesome") awesomeshirtshop.custom_shirt("M") awesomeshirtshop.custom_shirt(size="M", msg="I'm awesome", location="back") awesomeshirtshop.custom_shirt(size="M", msg="I'm awesome") awesomeshirtshop.custom_shirt(size="M") awesomeshirtshop.custom_shirt(msg="I'm awesome", size="M", location="back") awesomeshirtshop.custom_shirt(msg="I'm awesome", size="M") awesomeshirtshop.custom_shirt(size="M", location="back") print(awesomeshirtshop.get_total_order())
Custom shirt size "M" with text "I'm awesome" printed on "back" Custom shirt size "M" with text "I'm awesome" printed on "front" Custom shirt size "M" with text "I'll get A+" printed on "front" Custom shirt size "M" with text "I'm awesome" printed on "back" Custom shirt size "M" with text "I'm awesome" printed on "front" Custom shirt size "M" with text "I'll get A+" printed on "front" Custom shirt size "M" with text "I'm awesome" printed on "back" Custom shirt size "M" with text "I'm awesome" printed on "front" Custom shirt size "M" with text "I'll get A+" printed on "back" total order: 9 shirts
Write a file (named awesomepizzashop.py) with two functions:
make_pizza and get_total_order.
import awesomepizzashop awesomepizzashop.make_pizza(12, "pepperoni", "mushroom", "pineapple") awesomepizzashop.make_pizza(16, "pepperoni", "mushroom") awesomepizzashop.make_pizza(20, "pepperoni") awesomepizzashop.make_pizza(20, top2="pepperoni") awesomepizzashop.make_pizza(size=12, top1="pepperoni", top2="mushroom", top3="pineapple") awesomepizzashop.make_pizza(size=16, top3="pepperoni", top1="mushroom", top2="pineapple") awesomepizzashop.make_pizza(20, top3="pepperoni", top1="mushroom") awesomepizzashop.make_pizza(16) print(awesomepizzashop.get_total_order())
You order 12 inches pizza with pepperoni, mushroom, and pineapple You order 16 inches pizza with pepperoni, mushroom, and cheese You order 20 inches pizza with pepperoni, cheese, and cheese You order 20 inches pizza with cheese, pepperoni, and cheese You order 12 inches pizza with pepperoni, mushroom, and pineapple You order 16 inches pizza with mushroom, pineapple, and pepperoni You order 20 inches pizza with mushroom, cheese, and pepperoni You order 16 inches pizza with cheese, cheese, and cheese total order: 8 pizza