Solved

Consider This Text from Shakespeare's Romeo and Juliet: Soliloquy =

Question 6

Multiple Choice

Consider this text from Shakespeare's Romeo and Juliet: soliloquy = 'To be or not to be, that is the question'
Which of the following statements a) , b) or c) is false?


A) String method index searches for a substring within a string and returns the first index at which the substring is found; otherwise, a xe "ValueError exception"ValueError occurs. The following code returns 3: soliloquy.index('be')
B) String method rindex performs the same operation as index, but searches from the end of the string and returns the last index at which the substring is found; otherwise, a xe "ValueError exception"Value-Error occurs. The following code returns 3: soliloquy.rindex('be')
C) String methods find and rfind perform the same tasks as index and rindex but, if the substring is not found, return -1 rather than causing a xe "ValueError exception"Value-Error.
D) All of the above statements are true.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions