← Python Roadmap Home

07. Lists

List create, index, methods

List = ordered collection. Square brackets [].

fruits = ["apple", "mango", "banana"]
print(fruits[0])
fruits.append("orange")
print(len(fruits))
for f in fruits:
    print(f)

Change, add, remove — lists mutable hain.