Which of the following statement(s) would give an error after executing the following code?

S="Welcome to class XII"    # Statement 1

print(S)                    # Statement 2

S="Thank you"               # Statement 3

S[0]= '@'                   # Statement 4

S=S+"Thank you"             # Statement 5

(a) Statement 3

(b) Statement 4

(c) Statement 5

(d) Statement 4 and 5

 

Answer:

Question 9 Statement 4 gives -Teachoo.png

Statement 4 gives an error.

So, the correct answer is (b).

Remove Ads
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh is an IIT Kanpur graduate and has been teaching for 16+ years. At Teachoo, he breaks down Maths, Science and Computer Science into simple steps so students understand concepts deeply and score with confidence.

Many students prefer Teachoo Black for a smooth, ad-free learning experience.