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?
- AIn returns the string by removing trailing and leading white spaces
- BIt returns a list from the string depending upon the delimiter that we specify
- CIt returns the power of values passed
- 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.