Python Programming - Variables - Discussion

Discussion Forum : Variables - General Questions (Q.No. 12)
12.
Which of the following is a valid way to create an empty list?
my_list = []
my_list = lst()
my_list = {}
All of the above
Answer: Option
Explanation:

In Python, you can create an empty list using the following ways:

# Using square brackets:
my_list = []

#Using the list() constructor:
my_list = list()

Both of these methods will create an empty list in Python.

Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.