Account
Categories

List


Definition:

A list is a data type in Python that can store many values, whether single or multiple, easily in one place.

These values can be of any type, such as int, string, float, etc., which means they can store different types of data.

A list is ordered and allows duplicate values.

A list is mutable, which means that when we need to change it in a program, we can easily modify its data.

Types of Lists:

Syntax:

list_name = [value1, value2, value3]

Example:

fruits = ["apple", "papaya", "mango"]
print(fruits)

Output: