When I use the += in my function, I get this error: UnboundLocalError: local variable 'travel_log' referenced before assignment but it totally works with the append() function. What is the difference?
travel_log = []
def add_new_country(countries_visited, times_visited, cities_visited):
new_country = {}
new_country["country"] = countries_visited
travel_log += new_country