Home / Engineering / Problem Solving and Python Programming / Question

M

Mr. Dubey • 51.43K Points
Coach

Q.) To retrieve the character at index 3 from string s=”Hello” what command do we execute (multiple answers allowed)?

(A) s[]
(B) s.getitem(3)
(C) s. getitem (3)
(D) s.getitem(3)
Correct answer : Option (C) - s. getitem (3)

Explanation:
     getitem(..) can be used to get character at index specified as parameter.

Share

Discusssion

Login to discuss.