Which Python function removes whitespace from string ends?
-
A
trim()
-
B
strip()
Correct answer
-
C
clean()
-
D
remove()
Correct answer
B. strip()
13 views
Explanation
The strip() method returns a copy of the string with leading and trailing whitespace removed.
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ