#2: Taking a Vacation

In this section, we are introduced to functions in Python. We learn how to define, call, and import a function.  They consist of three main components the header, an optional comment, and the body. In this assignment, I’m calculating a vacation trip using CodeAcademy.com website.

 

First defining a function with one argument

def hotel_cost(nights):
          return 140 * nights

 

 

Figuring out the round-trip prices.

Calculating Transportation

Using some functions to calculate the hotel cost, plane ride cost, and car rental as well as other spendings

Using some functions to calculate the hotel cost, plane ride cost, and car rental as well as other spendings

Using some functions to calculate the hotel cost, plane ride cost, and car rental as well as other spendings