Report Bug

QusTo retrieve the character at index 3 from string s=”Hello” what command do we execute (multiple answers allowed)? Qusस्ट्रिंग 3 = "हैलो" से इंडेक्स 3 पर character को रिट्रीव करने के लिए हम किस कमांड को एक्सक्यूट करते हैं (multiple answers allowed)?


A. s[]
B. s.getitem(3)
C. s.__getitem__(3)
D. s.getItem(3)


Solution
C. s.__getitem__(3)



Explanation
__getitem(..) can be used to get character at index specified as parameter.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad