current_day, trip_flights): # The last flight is to home city, the end of the trip if trip_flights[-1].to_id == home_city_id: yield Trip( price=sum(flight.price for flight in trip_flights), flights=trip_flights) return # Everything visited or no vacation days left or no money ...
current_day, trip_flights): # The last flight is to home city, the end of the trip iftrip_flights[-1].to_id == home_city_id: yieldTrip( price=sum(flight.priceforflightintrip_flights), flights=trip_flights) return # Everything visited or no vacation days left or no money left ifno...