Ad
Code
Diff
  • def price(servings, price):
        return (max(0, servings) * price) + int(servings > 0)
    
    • def price(servings, price):
    • if servings >0:
    • cost = servings * price
    • cost += 1
    • return cost
    • else:
    • return 0
    • return (max(0, servings) * price) + int(servings > 0)