ExamVeda
Login
Home
Introduction to Python
?

To add a new element to a list we use which Python command?

Answer & Solution
Correct Answer: Option C
In Python, to add a new element to the end of a list, the append() method is used.
The syntax for using append() is list_name.append(element), where list_name is the name of the list and element is the value to be added.
append() adds the specified element to the end of the list, increasing the list's length by one.
Therefore, list1.append(5) will add the element 5 to the end of list1.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.