Hi @krr126 krr ,
It is important to format code when you post it. That enables users to see your indentation and other important details.
See How do I format code in my posts?.
This statement is necessary ...
... because it defines the
square_list variable and assigns an empty list to it.
If the variable,
square_list, has not been defined, your code will raise an error when it attempts to access it.
for loop executes with
square_list already having values in it prior to its execution, those items will be there in addition to the items that are appended to the list within the loop.
What happened to produce the result that you reported is that the first time you ran your code, the statement referred to above assigned an empty list to the variable. Then, all the squares got appended to the list as the loop executed. Up until then, everything was fine.
But then you removed the statement and executed your code again. Due to the manner in which Codecademy manages memory,
square_list was still in memory from the previous run, and the squares got appended to it again. The result was that you had two copies of each square in the list.
Restore the statement, and submit your code again.