def hotel_cost (hotel_nights):
  hotel_cost = 140 * hotel_nights
  print("Hotel: £" + str(hotel_cost))
  return hotel_cost

def flight_cost (city):
 if city == "1":
  print("Flight: £183")
  return 183
 elif city == "2":
  print("Flight: £420")
  return 420
 elif city == "3":
  print("Flight: £822")
  return 822
 elif city == "4":
  print("Flight: £175")
  return 175

def rental_car_cost (car_days):
  if car_days < 3:
    car_rental = 40 * car_days
    print("Car Rental: £" + str(car_rental))
    return car_rental
  elif car_days > 6:
    car_rental = 40 * car_days - 50
    print("Car Rental: £" + str(car_rental))
    return car_rental
  else:
    car_rental = 40 * car_days - 20
    print("Car Rental: £" + str(car_rental))
    return car_rental
    
def trip_cost (city, hotel_days, car_days, spending_money):
  return rental_car_cost(car_days) + hotel_cost (hotel_days) + flight_cost (city) + spending_money

print("Welcome to holiday cost calculator")
print("1: Paris")
print("2: Dubai")
print("3: New York")
print("4: Barcelona")
city = input("Please select your destination by entering a number:")
hotel_days = int(input("How many days are you planning to stay there?"))

car_needed = input("Do you need to rent a car? Yes/No").lower()
while (car_needed != "yes" and car_needed != "no"):
  car_needed = input("Do you need to rent a car? Yes/No").lower()

if (car_needed == "yes"):
  car_days = int(input("How many days do you need the car for?"))
else:
  car_days = 0

spending_money = int(input("How much spending money do you want to carry with you?"))

print("------------")
print("Ok great. I have booked your trip. Cost breakdown:")

total_cost = trip_cost(city, hotel_days, car_days, spending_money)
print("Spending money: £" + str(spending_money))
print("Total: £" + str(total_cost))