जब हम सूची ("हैलो") निष्पादित करते हैं तो आउटपुट क्या होता है?
What is the output when we execute list("hello") ?
A
['h', 'e', 'l', 'l', 'o']
B
[' hello']
C
['llo']
D
['olleh']
Explanation
When we execute list("hello"), Python converts the string "hello" into a list of its individual characters.
Explanation:
"hello"is a string.- Using
list("hello"), we convert the string into a list where each character becomes an element of the list.
So, the result will be:
['h', 'e', 'l', 'l', 'o']
Answer:
(A) ['h', 'e', 'l', 'l', 'o']
Correct Answer: A) ['h', 'e', 'l', 'l', 'o']