Skip to content

SaadAmin5/functions1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

functions1

Following was the task that i performed:

● Create a Python file called holiday.py. ● Your task will be to calculate a user’s total holiday cost, which includes the plane cost, hotel cost, and car-rental cost. ● First, get the following user inputs: ○ city_flight: The city they will be flying to. (You can create some options for them. Remember each city will have different flight costs.) ○ num_nights: The number of nights they will be staying at a hotel ○ rental_days: The number of days for which they will be hiring a car. ● Next, create the following four functions: ● hotel_cost: This function will take num_nights as an argument, and return a total cost for the hotel stay (you can choose the price per night charged at the hotel). ● plane_cost: This function will take city_flight as an argument and return a cost for the flight. (Hint: use if/else if statements in the function to retrieve a price based on the chosen city.) ● car_rental: This function will take rental_days as an argument and return the total cost of the car rental (you can choose the daily rental cost.) ● holiday_cost: This function will take the three arguments hotel_cost, plane_cost, car_rental. Using these three arguments, you can call all three of the above functions with respective arguments and finally return a total cost for your holiday. ● Print out all the details about the holiday in a readable way. ● Try running your program with different

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages