[]
`. Here's an example program :# create a list of numbers
numbers = [1, 2, 3, 4, 5]
# print the list
print(numbers)
In this program, a list of numbers is created using square brackets, and assigned to the variable `numbers`. The `print()
` function is then used to print the list to the console. The output of this program will be :
[1, 2, 3, 4, 5]
list
of any type of data in Python, including strings, integers, and even other lists. Here's an example program that creates a list of strings :# create a list of strings
fruits = ['apple', 'banana', 'cherry', 'orange']
# print the list
print(fruits)
['apple', 'banana', 'cherry', 'orange']
fruits
`. The `print()
` function is then used to print the list to the console.