Learn
Taking a Vacation
Planning Your Trip

When planning a vacation, it’s very important to know exactly how much you’re going to spend.

def wages(hours): # If I make $8.35/hour... return 8.35 * hours

The above example is just a refresher in how functions are defined.

Let’s use functions to calculate your trip’s costs.

Instructions

1.

Define a function called hotel_cost with one argument nights as input.

The hotel costs $140 per night. So, the function hotel_cost should return 140 * nights.

Folder Icon

Take this course for free

Already have an account?