INTERACTIVE ONLINE COURSE

Python 3

FOR BEGINNERS


"The first Python course that simply amazed me. Very well explained and easy to understand." (Alexandru Cosmin)

"The best Python course in Romania." (Iulian Geană)


ALL REVIEWS
LESSON 10
PAGE 1 / 5
Lists
Home >>> Online Lessons, Python 3

What is a List?

Lists are data collections that contain ordered data and have a finite number of elements that can be accessed using indices. Additionally, lists can be modified after creation, as you will see below. The data type is called list.



A list contains multiple data elements, in this case, strings, which are grouped and separated by the comma operator "," and is defined directly between two square brackets:
Editor - lesson_10.py
       
Console/Output done
DETAILS



Accessing list elements is done similarly to strings, using indexing from 0 to len()-1, which is the length of the list in this case, minus one:



Lists are very cool! They can hold data of different types, as you will see next!
Run the program, then proceed to the next page.
 home   list  CONTENTS   perm_identity   arrow_upward