Skip to main content

Python List

Lists are used to store multiple items in a single variable. Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are tuples, sets and dictionary, all with different qualities and usage.

Lists are created using square brackets [ ]. List are mutable. It is just like dynamic sized arrays.

List can be defined as a  collection of values or items of different types. It does not need any built in function for its creation. It can contain duplicate values with their distinct positions.

list_1=[1,2,3,4,5,6]

Size of List:

In Python, we can simple get to know the size of any given list with the help of code.

List2=[5,10,20,25,30]
print(len(List2))

Output5

Characteristics

  • The lists are ordered.
  • The element of the list can access by index.
  • The lists are the mutable type.
  • The lists are mutable types.
  • A list can store the number of various elements.
Tags
Submitted by devanshi.srivastava on June 7, 2021

Devanshi, is working as a Data Scientist with iVagus. She has expertise in Python, NumPy, Pandas and other data science technologies.

About

At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.