Lists in Python

CiklusvezérlésLista metódusok

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

Az anyagokat átnéztük és ellenőriztük, de hibák továbbra is előfordulhatnak. A tartalom kizárólag oktatási célt szolgál, ezért saját felelősségre használd, és szükség esetén ellenőrizd más forrásokkal is.

✨ Kérdezd Larát — a tanulási partnered

Fedezd fel a személyre szabott tanulási támogatást. Lara elmagyarázza az anyagot, összefoglalja a témákat és megválaszolja a kérdéseidet — az Go csomagtól elérhető.


Lara segít gyorsabban tanulni — kizárólag a ReadyTools Go, Plus és Max tagoknak.

Kövesd nyomon a fejlődésed 🚀

Tanulj egyszerűbben utad nyomonkövetésével teljesen ingyen.