Lists in Python

SchleifensteuerungListen-Methoden

Lists are one of the most versatile and commonly used data structures in Python. They are ordered collections that can hold items of different types, and they are mutable – meaning you can change them after creation.

Lists are perfect for storing sequences like shopping items, scores, names, or any collection you need to work with.

Creating Lists

Use square brackets [] and separate items with commas.

Accessing List Items

Lists are zero-indexed – first item is at position 0. Use negative indices to count from the end.

Modifying Lists

Change items by index or add new ones.

List Slicing

Get a portion of the list with slicing [start:end:step]. End is exclusive.

List Length and Membership

Nested Lists

Lists can contain other lists – useful for grids or matrices.

Quick Quiz

Wir haben die Materialien überprüft, dennoch können Fehler vorkommen. Der Inhalt dient ausschließlich Bildungszwecken, daher verwende ihn auf eigene Verantwortung und überprüfe ihn bei Bedarf mit anderen Quellen.

✨ Frag Lara — deine KI-Lernpartnerin

Entsperre personalisierte Lernunterstützung. Lara kann Lektionen erklären, Themen zusammenfassen und deine Lernfragen beantworten — verfügbar ab dem Go-Tarif.


Lara hilft dir, schneller zu lernen — exklusiv für ReadyTools Go-, Plus- und Max-Mitglieder.

Verfolge deinen Fortschritt 🚀

Lerne einfacher, indem du deinen Fortschritt kostenlos verfolgst.