CBSE Class 12 Computer Science Question 4 of 44

Solved 2025 Sample Question Paper CBSE Class 12 Computer Science (083) — Question 4

Back to all questions
4
Question

Question 4

What is the output of the expression ?

country = 'International'
print(country.split("n"))
  1. ('I', 'ter', 'atio', 'aI')
  2. ['I', 'ter', 'atio', 'al']
  3. ['I', 'n', 'ter', 'n', 'atio', 'n', 'al']
  4. Error
Answer

['I', 'ter', 'atio', 'al']

Reason — The code defines a string country = 'International' and uses the split("n") method to split the string at each occurrence of the letter "n". This breaks the string into a list of parts: ['I', 'ter', 'atio', 'al'], with each occurrence of "n" removed and the remaining substrings stored as separate elements in the list. The print() function then outputs this list.