Starlit Daily

📚 › Python: the friendliest first language

5. Lists

Este artículo se traducirá automáticamente. Por ahora se muestra en inglés.

A list holds items in order, inside square brackets. Positions start at 0. len(list) gives the count and append adds an item to the end.

Lists can change, so you can add, remove and replace items.

Ver ejemplo

fruits = ["mango", "banana"]
fruits.append("jackfruit")
print(fruits[0], len(fruits))

✍️ Ahora te toca

Make a list of 3, 8 and 10, then print its length.

← Volver al curso