Taking Vacation

screenshot-25

here we define our function first without argument then set 42 to the variable answer

screenshot-26

we define our function hotel cost in order to calculate the hotel cost per night

screenshot-27

gain we define another function name plan_ride_cost to determine the cost of the ride for each of our city and using an if statement

screenshot-28

we define the function rental_car to calculate the renting per day

screenshot-29

now we want to know our entire dispenses (the cost of the trip), so we define a new function called trip_cost that take two arguments and return the sum of calling our to recent function plan_ride_cost and rental_car_cost and hotel_cost.

screenshot-30

we add another argument “spending_money” inside the trip_cost function, so we add add the spending_money in the return so it will modify what the function does.

screenshot-31

after having set all my our plan now we want to choose Los Angeles for 5 day with $600 in our pocket. thus, we use print statement as “print trip_cost(“Los Angeles”, 5, 600) and we are done!

we going to plane our vacation