Question 69Asked in Bihar STET 2025 Paper II Computer Science, 3 Nov 2025, Shift 2 (2:00 PM)

Identify the output of the following code segment: S = "an apple. a toy."निम्‍नलिखित कोड खंड (code segment) के आउटपुट की पहचान कीजिए :

Identify the output of the following code segment: S = "an apple. a toy." S = s. find ( 'a ' , 2) print (s)
निम्‍नलिखित कोड खंड (code segment) के आउटपुट की पहचान कीजिए : S = "an apple. a toy." S = s. find ( 'a ' , 2) print (s)
  1. A00
  2. B11
  3. C33
  4. Da''a'
Show answerHide answer

Correct answer: (C) 33

Explanation

The code is garbled (S and s, and the space after 'a' are likely typing errors). Read as s.find('a', 2), the search starts at index 2 and the next 'a' in "an apple. a toy." is at index 3.कोड विकृत है (S और s, और 'a' के बाद का स्पेस शायद टाइपिंग त्रुटियाँ हैं)। इसे s.find('a', 2) पढ़ें तो खोज इंडेक्स 2 से शुरू होती है और "an apple. a toy." में अगला 'a' इंडेक्स 3 पर है।

From Bihar STET 2025 Paper II Computer Science PYQ, 3 Nov 2025, Shift 2 (2:00 PM)

This is question 69 of Bihar STET 2025 Paper II Computer Science PYQ, 3 Nov 2025, Shift 2 (2:00 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.