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)
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 पर है।