Learn Before
Concept

List

  • List is a built-in data type, it is also a collection datatype( lists accommodate elements/items of various datatype )
  • List is also a sequence data type which can accommodate items of various basic data types like integers, float etc. but usually items in a list are of same basic data type.
  • A list contains values separated by comma inside a square bracket.
  • Lists are resizable. Items in a list can be added, removed and modified after the list is created.
  • Lists are mutable, that means contents of a list can be changed.
  • Lists can be nested, that means we can create a list containing another list.
my_list = [1,"1cademy",12.59,True] my_list

Output

[1, '1cademy', 12.59, True]

0

3

Updated 2021-06-13

Tags

Python Programming Language

Data Science

Related