Isn't the logic incorrect for this?


#1



https://www.codecademy.com/courses/python-beginner-P5YtY/1/4?curriculum_id=4f89dab3d788890003000096


My code does not have any issues, but isn't it logically incorrect to assume you would be renting a car for the same amount of days as you would for nights spent at a hotel? Shouldn't the amount of nights stayed at a hotel be 1 less than the amount of days you rent a car? Making the use of days in the final return statement not actually realistic?
I don't travel a lot, so maybe you don't rent a car the following day, assuming you are getting a flight/hotel package, traveling to and from the airport to the hotel is probably a provided service.


Replace this line with your code.


#2

Hi @elsien ,

The car rental cost is based on the amount of time for which you rent the car, with each total period of 24 hours constituting 1 day. So, if you get the car at 1:00 in the afternoon, stay at the hotel for 1 night, then return the car at 1:00 in the afternoon the next day, the 24 hours during which you had the car are considered to be 1 day.


#3

Thanks for clearing that up! I was kind of confused as to how the logic worked for that situation. I was able to suspend that confusion for the sake of the example and still able to absorb the lesson either way!
I appreciate the reply :slight_smile:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.