InterviewSolution
Saved Bookmarks
| 1. |
What is a string slice ? How is it useful ? |
|
Answer» A sub-part or a slice of a string, say s, can be obtained using s[n : m] where n and m are integers. Python returns all the characters at indices n, n+1, n+2,…. m-1. For example, ‘Oswaal Books’ [1 : 4] will give ‘swa’ |
|