Kate and Michael want to buy a pizza and share it. Depending on the price of the pizza, they are going to divide the costs:

* If the pizza is less than €5,- Michael invites Kate, so Michael pays the full price.
* Otherwise Kate will contribute 1/3 of the price, but no more than €10 (she's broke :-) and Michael pays the rest.

How much is Michael going to pay? Calculate the amount with two decimals, if necessary.

Difficulty: introductory

Starter code:

def michael_pays(costs):
	

Solutions:
def michael_pays(cost):
    return round(cost if cost < 5 else max(cost*2/3, cost-10), 2)

def michael_pays(c):
    return round(c if c < 5 else c * 2 / 3 if c <= 30 else c - 10, 2)

def michael_pays(costs):
    if costs < 5:
        michael = costs
    else:
        kate = min(costs / 3, 10)
        michael = costs - kate
    return round(michael, 2)

def michael_pays(c):
    return round(max(c if c < 5 else c * 2/3, c - 10), 2)

def michael_pays(costs):
    return round(costs - (costs >= 5)*min(costs/3., 10), 2)

def michael_pays(costs):
    if costs<5: return round(costs, 2)
    else: return round(max(costs-10, 2/3*costs), 2)

def michael_pays(costs):
    return round(costs - min(0 if costs < 5 else 10, costs / 3), 2)

def michael_pays(costs):
    return round(costs, 2) if costs < 5 else round(max(costs-10, costs/3*2), 2)

def michael_pays(costs):
    kate = round((costs/3), 2)
    if costs < 5:
        return round(costs, 2)
    return round(costs - kate, 2) if kate <= 10 else round(costs - 10, 2)

def michael_pays(costs):
    micheal=0
    if costs<5:
        micheal = costs
    else:
        if ((1/3)*costs)>10:
             micheal = costs-10
        else:
             micheal =  costs-((1/3)*costs)
    
    try:
        if isinstance(micheal,float):
             micheal = float("{0:.2f}".format(micheal))
    except:
        micheal = micheal
        
    return micheal