Q. Find the errors:


(a)

S = "PURA VIDA"

print(S[9]) + S[9: 15])


(b)

S = "PURA VIDA"

S1 = S[: 10] + S[10 :]

S2 = S[10] + S[-10]


(c)

S = "PURA VIDA"

S1 = S * 2

S2 = S1[-19] + S1[-20]

S3 = S1[-19:]


(d)

S = "PURA VIDA"

S1 = S[: 5]

S2 = S[5: ]

S3 = S1 * S2

S4 = S2 + '3'

S5 = S1 + 3



Answer =

(a)
Index not available in given value.

(b)
Index not available in given value.

(c)
Error in 3rd line that is ‘index is out of range’.

(d)
Error in 4th and 6th line.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post