What is the expected output of the following code?
print(list(‘hello’))
A . None of the above.
B. hello
C. [h, e, l, l, o]
D. [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]
E. [‘h’ ‘e’ ‘l’ ‘l’ ‘o’]
Answer: D
Explanation:
Topic: list()
Try it yourself:
print(list(‘hello’)) # [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]
A string is a sequence of characters
and works very fine with the list() function.
The result is a list of strings, in which every character is a string of its own.
Latest PCEP-30-02 Dumps Valid Version with 124 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund