Whats wrond with tice code

destinations = ['Pris, 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 = destination.index('Pris, France')
  return destination_index
print(get_destination_index('Los Angeles, USA'))

:wave: Welcome @demongame77!

The issue with this code is that you made a typo in the get_destination_index function.

Should be

destination_index = destinations.index(destination)  # destination is the function argument

yes and i should not have call the the function with

get_destination_index(destinations) #will get erro

Oh, yes, I missed that.

Please mark a post as the solution.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.