A list of squares · Una lista de cuadrados
A list of squares
Build a list one item at a time instead of printing each value.
squares.append(x) adds x to the end of the list. Printing a whole list shows it in square brackets, with commas between the items.
Una lista de cuadrados
Construya una lista elemento por elemento en lugar de imprimir cada valor.
squares.append(x) añade x al final de la lista. Imprimir toda la lista muestra el contenido entre corchetes, con comas separando los elementos.
Start with an empty list, add the squares of 1 to · hasta 5 with .append(), then print the list. It should show [1, 4, 9, 16, 25]. · Comience con una lista vacía, agregue los cuadrados de 1 a 5 con .append(), luego imprima la lista. Debería mostrar [1, 4, 9, 16, 25].
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.