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

In Python language, which of the following is correct for ‘strip ( )’ function?

  1. AIn returns the string by removing trailing and leading white spaces
  2. BIt returns a list from the string depending upon the delimiter that we specify
  3. CIt returns the power of values passed
  4. DIt returns the string with the first character in upper case and lowering the case for rest of the string
Show answerHide answer

Correct answer: (A) In returns the string by removing trailing and leading white spaces

Explanation

strip() returns a copy of the string with leading and trailing whitespace removed. split() makes a list, capitalize() changes case.

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

This is question 114 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.