Question 117Asked in DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)

In Python language, which of the following method of lists is used to add an element to

In Python language, which of the following method of lists is used to add an element to the end of the list?
  1. Aindex ( )
  2. Bsort ( )
  3. Cpop ( )
  4. Dappend ( )
Show answerHide answer

Correct answer: (D) append ( )

Explanation

append() adds a single element to the end of a list. pop() removes an element, sort() orders the list, index() finds a position.

From DSSSB TGT Computer Science PYQ, 7 Feb 2024, Shift 2 (12:30 PM)

This is question 117 of DSSSB TGT Computer Science PYQ, 7 Feb 2024, Shift 2 (12:30 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.