CBSE Class 11 Computer Science
Question 72 of 91
String Manipulation — Question 17
Back to all questions 17
Question Question 8c
Find the errors. Find the line numbers causing errors.
- S = "PURA VIDA"
- S1 = S * 2
- S2 = S1[-19] + S1[-20]
- S3 = S1[-19 :]
Answer
The error is in line 3. S1[-19] and S1[-20] are trying to access out of bound indexes.