Guest User

reservation

a guest
Feb 9th, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. booked_day = int(input())
  2. booked_month = int(input())
  3. day_in = int(input())
  4. month_in = int(input())
  5. day_out = int(input())
  6. month_out = int(input())
  7.  
  8. night_price = 30
  9. discount = 0
  10. diff = day_in - booked_day
  11.  
  12. if booked_month < month_in:
  13.     night_price = 25
  14.     discount = 0.8
  15. elif diff >= 10:
  16.     night_price = 25
  17.  
  18. if discount > 0:
  19.     hotel_price = (day_out - day_in) * night_price * discount
  20. else:
  21.     hotel_price = (day_out - day_in) * night_price
  22.  
  23. print(f'Your stay from {day_in}/{month_in} to {day_out}/{month_out} will cost {hotel_price:.2f}')
Add Comment
Please, Sign In to add comment