Institute of Computer Science
  1. Courses
  2. 2024/25 fall
  3. Introduction to Programming (MTAT.03.236)
ET
Log in

Introduction to Programming 2024/25 fall

  • Home Page
  • Introduction
  • Expressions
  • Conditional Execution
  • Functions
  • Iterations
  • Strings
  • Files
  • Lists
  • Graphics?
< eelmineTable of Contentsnext >

8.1 WHAT IS A LIST?

You can think of a list as something that stores a collection of different items where these items can be changed, removed, accessed, or new items added. In more formal terms, a list is a mutable data type, meaning it can be changed. It is also ordered, meaning that Python will keep track of the order in which the items were entered into the list. It can store all different data types, and the elements in the list can be of mixed type, too. Lists comprise values that are between square brackets [].

Here’s a very simple example of creating a list and printing its contents to the console. This is a simple list of strings that contains the titles of someone’s favorite songs.

< eelmineTable of Contentsnext >

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment