adplus-dvertising
frame-decoration

Question

To retrieve the character at index 3 from string s=”Hello” , what command do we execute ?

a.

s[].

b.

s.getitem(3)

c.

s.__getitem__(3)

d.

s.getItem(3)

Posted under Python

Answer: (c).s.__getitem__(3)

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. To retrieve the character at index 3 from string s=”Hello” , what command do we execute ?