2.6.1.1 Creating, Accessing, and Modifying Lists
Python Programming
A list is created by placing items inside square brackets [ ], separated by commas. Lists can contain items of different types, such as numbers, strings, or even other lists.
Example: Create a list of your favorite fruits.
python
fruits = ["Mango", "Apple", "Banana"]
print(fruits)
# Output: [’Mango’ ’Apple ’ ’Banana ’ ]Explanation: This code creates a list named 'fruits' containing three elements and then prints the list.