The Borderless Tourist - Syntax Error - Help needed

Hi All

This block of code is returning a syntax error and I have no idea why.

Is anyone able to help me with this?

Thanks a million - you guys rock!

===================================

destinations = ['Paris, France', 'Shanghai, China', 'Los Angeles, USA', 'São Paulo, Brazil', 'Cairo, Egypt']

test_traveler = ['Erin Wilkes', 'Shanghai, China', ['historical site', 'art']]

def get_destination_index(destination):
  destination_index = destinations.index(destination)
  return destination_index
def get_traveler_location(traveler):
  traveler_destination = traveler[1]
  traveler_destination_index = get_destination_index(traveler_destination) 
  return traveler_destination_index

test_destination_index = get_traveler_location(test_traveler)
#print(test_destination_index)


attractions = []
for destination in destinations:
  attractions.append([])
def add_attraction(destination, attraction):
 
  try:
    destination_index = get_destination_index(destination)
    attractions_for_destination = attractions[destination_index].append(attraction)
    except SyntaxError:
      return
    
    add_attraction("Los Angeles, USA",['Venice Beach', ['beach']]) 

    print(attractions)

=======================

what is the error message?

Double check your indentation everywhere.

1 Like

It just comes up with nothing and no error message.

Hi,
As @lisalisaj says, check your indentation. ‘except’ should be level with ‘try’. And the lines following it appear to be inside the function. Should they be?

Hope this helps