KnowledgeBoat Logo

Computer Science

Find the errors. Find the line numbers causing errors.

  1. S = "PURA VIDA"
  2. S1 = S * 2
  3. S2 = S1[-19] + S1[-20]
  4. S3 = S1[-19 :]

Python String Manipulation

6 Likes

Answer

The error is in line 3. S1[-19] and S1[-20] are trying to access out of bound indexes.

Answered By

2 Likes


Related Questions