Advertisement
Veselina_M

Untitled

Mar 3rd, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.94 KB | None | 0 0
  1. month=input()
  2. is_may=month=="May"
  3. is_june=month=="June"
  4. is_july=month=="July"
  5. is_august=month=="August"
  6. is_september=month=="September"
  7. is_october=month=="October"
  8.  
  9. nights_number=int(input())
  10.  
  11. price_studio=0
  12. price_appartment=0
  13.  
  14. accomodation=""
  15.  
  16. if is_may:
  17.     if accomodation=="Studio":
  18.         price_studio=50
  19.         if 7<nights_number<=14:
  20.             price_studio*=0.95
  21.         if nights_number>14:
  22.             price_studio*=0.7
  23.     if accomodation=="Apartment":
  24.         price_appartment=65
  25.         if nights_number>14:
  26.             price_appartment*=0.9
  27. elif is_june:
  28.     if accomodation=="Studio":
  29.         price_studio=75.20
  30.         if nights_number>14:
  31.             price_studio*=0.8
  32.     if accomodation=="Apartment":
  33.         price_appartment=68.70
  34.         if nights_number>14:
  35.             price_appartment*=0.9
  36. elif is_july:
  37.     if accomodation=="Studio":
  38.         price_studio=76
  39.     if accomodation=="Apartment":
  40.         price_appartment=77
  41.         if nights_number>14:
  42.             price_appartment*=0.9
  43. elif is_august:
  44.     if accomodation=="Studio":
  45.         price_studio=76
  46.     if accomodation=="Apartment":
  47.         price_appartment=77
  48.         if nights_number>14:
  49.             price_appartment*=0.9
  50. elif is_september:
  51.     if accomodation=="Studio":
  52.         price_studio=75.20
  53.         if nights_number>14:
  54.             price_studio*=0.8
  55.     if accomodation=="Apartment":
  56.         price_appartment=68.70
  57.         if nights_number>14:
  58.             price_appartment*=0.9
  59. elif is_october:
  60.     if accomodation=="Studio":
  61.         price_studio=50
  62.         if 7<nights_number<=14:
  63.             price_studio*=0.95
  64.         if nights_number>14:
  65.             price_studio*=0.7
  66.     if accomodation=="Apartment":
  67.         price_appartment=65
  68.         if nights_number>14:
  69.             price_appartment*=0.9
  70.  
  71. print(f"Apartment: {nights_number*price_appartment:.2f} lv.")
  72. print(f"Studio: {nights_number*price_studio:.2f} lv.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement