CBSE Class 11 Computer Science Question 70 of 91

String Manipulation — Question 15

Back to all questions
15
Question

Question 8a

Find the errors. Find the line numbers causing errors.

  1. S = "PURA VIDA"
  2. print(S[9] + S[9 : 15])

Answer

The error is in line 2. Length of string S is 9 so its indexes range for 0 to 8. S[9] is causing error as we are trying to access out of bound index.

Answer