Check sibling questions

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:

Statement 4 gives an error.

So, the correct answer is (b).

  1. Computer Science - Class 12
  2. Solutions to CBSE Sample Paper - Computer Science Class 12

About the Author

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo