Solved

Based on the String Sentence = '\T \N This Is

Question 1

Multiple Choice

Based on the string sentence = '\t \n This is a test string. \t\t \n'
Which of the following statements is false?


A) There are several string methods for xe "stripping whitespace"xe "whitespace:removing"xe "removing whitespace"removing whitespace from the ends of a string. Because strings are immutable each returns a new string leaving the original unmodified.
B) The following code uses string method strip to remove the leading and trailing whitespace from sentence: sentence.strip()
C) The following code snippets first use method xe "string built-in type:lstrip"xe "lstrip string method"lstrip to remove only leading whitespace from sentence: sentence.lstrip()
Then use method xe "string built-in type:rstrip"xe "rstrip string method"rstrip to remove only trailing whitespace:
Sentence.rstrip()
D) Methods strip, lstrip and rstrip remove only leading and/or trailing spaces.

Correct Answer:

verifed

Verified

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents