CBSE Class 11 Computer Science Question 15 of 91

String Manipulation — Question 5

Back to all questions
5
Question

Question 5

Which of the following functions will return the first three characters of a string s?

  1. s[3:]
  2. s[:3] ✓
  3. s[-3:]
  4. s[:-3]
Answer