# # # #PYRET fun pen-cost(num-pens :: Number, message :: String) -> Number: doc: ```total cost for pens, each 25 cents plus 2 cents per message character``` num-pens * (0.25 + (string-length(message) * 0.02)) where: pen-cost(1, "") is 0.25 end fun add-shipping(order-amt :: Number) -> Number: doc: "add shipping costs to order total" if order-amt <= 10: order-amt else if (order-amt > 10) and (order-amt <= 30): order-amt + 8 else: order-amt + 12 end end # # # #PYTHON def pen_cost(num_pens: int, message: str) -> float: '''total cost for pens, each at 25 cents plus 2 cents per message character''' return num_pens * (0.25 + (len(message) * 0.02)) def add_shipping(order_amt: float) -> float: '''increase order price by costs for shipping''' if order_amt <= 10: return order_amt elif (order_amt > 10) and (order_amt < 30): return order_amt + 8 else: return order_amt + 12 def test_pencost(): assert pen_cost(1, "") == 0.25