Computer Science

Find the errors. Find the line numbers causing errors.

  1. S = "PURA VIDA"
  2. S1 = S[: 5]
  3. S2 = S[5 :]
  4. S3 = S1 * S2
  5. S4 = S2 + '3'
  6. S5 = S1 + 3

Python String Manipulation

7 Likes

Answer

The errors are in line 4 and line 6. Two strings cannot be multiplied. A string and an integer cannot be added.

Answered By

2 Likes


Related Questions