Qus : What is the output when we execute list("hello")?
Qusजब हम list ( "hello") निष्पादित करते हैं तो आउटपुट क्या है?
A. ['llo'] B. ['hello']
C. ['h', 'e', l', 'l', 'o'] D. None of the above
Solution
C. ['h', 'e', l', 'l', 'o']
Explanation
<p><span style="font-size: 14px;">The list() function converts an iterable into a list.</span></p><p><span style="font-size: 14px;">A string is an iterable where each character is an element.</span></p><p><span style="font-size: 14px;">So list("hello") breaks the string into a list of its characters</span></p>