Podcast
Questions and Answers
Which of the following is the correct syntax to create an empty list in Python?
Which of the following is the correct syntax to create an empty list in Python?
- list = set()
- list = [] (correct)
- list = {}
- list = ()
What is the purpose of the 'append()' method in Python lists?
What is the purpose of the 'append()' method in Python lists?
- To sort the elements in the list
- To remove an element from the list
- To add an element to the end of the list (correct)
- To check if an element exists in the list
Which of the following methods can be used to remove an element from a list in Python?
Which of the following methods can be used to remove an element from a list in Python?
- remove()
- delete()
- clear()
- pop() (correct)