Course Content
How to Add a Virtual Environment in Python
0/1
Set
0/1
Python
About Lesson

In Python, a list is a built-in data structure that allows you to store an ordered collection of items. Lists can contain elements of different types, including numbers, strings, and even other lists. They are mutable, meaning you can modify them after their creation.

  1. Ordered: The items in a list maintain their order, and you can access them using their index (starting from 0).
  2. Mutable: You can change, add, or remove items after the list has been created.
  3. Dynamic: Lists can grow and shrink in size as you add or remove elements.
Python
# List in Python 
num = [1,2,3,4,5,6,7]
print(f"{num}")
Python
# String in list
rgb = ["Red", "Green", "Blue", "Pink", "Black"]
print(f"{rgb}")
print(type(rgb)) #Function: This built-in function returns the type of the specified object.