PGoCareerGoCareer prep tools
Home
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

Python · Theory

Python Lists

← All stacks

Theory

30/268

Python Lists

A list is an ordered, changeable row of items. names = ["Asha", "Ravi"]. Index starts at 0: names[0] is Asha. Negative: names[-1] is the last. Length: len(names). This is the collection you will use every day.

Mutable means you can change it. append("Neha") adds at the end. pop() removes the last. names[0] = "Asha K" overwrites. Slice names[0:2] is a new list — original stays unless you assign back.

Let’s take this on the board. Start ["Asha", "Ravi"]. append Neha. len is 3. print names[0] → Asha. names[3] → IndexError. append adds one item; extend adds many. Mixing them up is a viva trap.

Interview line: ordered + mutable + indexable. Tuple is ordered but cannot change. Dict is key→value, not index. Pick list when order and edits both matter.

Python Lists — output — 3, Asha, then ['Asha', 'Ravi', 'Neha'].

Diagram
index →  0       1       2
  list  → [Asha,  Ravi,  Neha]
Exam tip

Define list with three properties and one method.

Example

# Lists
names = ["Asha", "Ravi"]
names.append("Neha")
print(len(names))
print(names[0])
print(names)

Python Lists — output: 3, Asha, then ['Asha', 'Ravi', 'Neha'].

Short notes

  • DefA list is an ordered, changeable row of items.
  • RuleMutable means you can change it.
  • RememberLet’s take this on the board.
  • UseInterview line: ordered + mutable + indexable.

Questions

1

Explain Lists as if you are teaching a junior — definition, then one tiny script.

2

What does the example print, and why?

3

What mistake do freshers make with Lists?

Previous← Control Statements in PythonNextPython List Methods →
P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.