A list of squares · Uma lista de quadrados
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.
Uma lista de quadrados
Construa uma lista um item de cada vez em vez de imprimir cada valor.
squares.append(x) adiciona x ao final da lista. Imprimir uma lista inteira mostra-a entre colchetes, com vírgulas entre os itens.
Start with an empty list, add the squares of 1 to · até 5 with .append(), then print the list. It should show [1, 4, 9, 16, 25]. · Comece com uma lista vazia, adicione os quadrados de 1 a 5 com .append(), depois imprima a lista. Deve mostrar [1, 4, 9, 16, 25].
Click Run to see the output here. · Clique em Executar para ver a saída aqui.