Kodewick
Start learning →
Starter←→0 / 80

Rowing boat hire

#004StarterFunctions3 min

Rowing boats on the park lake are hired by the hour: usually 30 an hour, but the price changes on holidays. Write boat_cost(hours, per_hour) to return what you pay. When only the hours are given, use 30 an hour.

Examples
boat_cost(2)→60
boat_cost(3, 20)→60
main.py
# your code here: give per_hour on the def line below a default of 30
def boat_cost(hours, per_hour):
    return hours * per_hour
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.