HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Glossary
  2. /Python and data
  3. /List (in Python)

What is List (in Python)?

In short

A list is an ordered collection of values written in square brackets, for example [3, 7, 2]. Its items can be changed, added and removed.

In simple words

Items are numbered from 000, so the first item is marks[0]. A list can hold numbers, text or even other lists. Useful actions are append to add an item, len to count, sorted to sort and slicing such as marks[1:3] to take a part. A list is not a NumPy array: arithmetic on a list does not work element by element.

Example

This prints 4 77.75, the number of marks and their mean.

Learn it properly

  • Lessons on this topic
  • Test yourself

Related terms

  • NumPy Array
  • For Loop
  • Dictionary (in Python)

← All glossary terms

Learn it in

  1. Lists: Many Values in One Variable
All lessons on this topic →

Practise

  1. Here is a table of marks: one row for each student, and one column for each test…Medium
  2. What do a and b show at the end? Say it before you run it.Medium
  3. The list is marks = [45, 78, 90, 62, 38, 85, 71]…Easy
  4. Find the positionEasy

Quick questions

  1. A program removes items from a list while a loop reads the same list. What does the…Hard
  2. A program joins lists with + and with +=, and then changes one of them through another…Hard
  3. A program changes a list with several methods, takes a copy first, and ends with a slice…Hard

More Python and data terms

  1. Cell (in a Python notebook)
  2. Class and Special Methods (in Python)
  3. Function (in Python)
  4. If Statement (in Python)
  5. Import (Python modules and libraries)
  6. Mean, Median and Mode
All Python and data terms →

Try it yourself

Python labs run in your browser. Type the code, run it and see what happens.

Open a Python lab