I keep getting the wrong output for step 48 in the borderless tourist challenge, and I’m not quite sure what I’m doing wrong. So, here’s my code for the part that keeps printing out incorrectly:
def find_attractions(destination, interests): destination_index = get_destination_index(destination) attractions_in_city = attractions[destination_index] attractions_with_interest =  for attraction in attractions_in_city: possible_attraction = attraction attraction_tags = attraction for interest in interests: if interest in attraction_tags: attractions_with_interest.append(possible_attraction) return attractions_with_interest la_arts = find_attractions("Los Angeles, USA", ['art']) print(la_arts)
And here’s the result I get:
[[['the Louvre', ['art', 'museum']], ['Arc de Triomphe', ['historical site', 'monument']]], [['Yu Garden', ['garden', 'historcical site']], ['Yuz Museum', ['art', 'museum']], ['Oriental Pearl Tower', ['skyscraper', 'viewing deck']]], [['Venice Beach', ['beach']], ['LACMA', ['art', 'museum']]], [['São Paulo Zoo', ['zoo']], ['Pátio do Colégio', ['historical site']]], [['Pyramids of Giza', ['monument', 'historical site']], ['Egyptian Museum', ['museum']]]] [['LACMA', ['art', 'museum']]]
It does technically give the expected result at the end [‘LACMA’, [‘art’, ‘museum’]], but for whatever reason, it just keeps printing out the entire loop as well. I’ve tried going through every indentation, and a whole host of other things, I just can’t quite work out what I’ve done wrong. What else should I look out for when debugging?