I have a question of task 31-34.
Why is it instructed or neccessary to define a variable called attractions_for_destination to do the work of appending lists to the attractions variables?
It is supposed to be in this form according to instructions and tutorial.
attractions_for_destination = attractions[destination_index].append(attraction)
Can’t the same results be obtained by just executing the operation of appending, after the previous condition mentioned in the exercise is met, without defining it on a variable? Like in this form:
attractions[destination_index].append(attraction)
I’m just trying to understand if it is an unnecesary variable for this task or there is an important reason for it to be there that I can’t seem to find out. Any response is helpful.
Greetings all!
This is the project’s link:
https://www.codecademy.com/paths/computer-science/tracks/cspath-cumulative-tourism/modules/cspath-boredless-tourist/projects/the-boredless-tourist