1.

What is the output when we execute list(“hello”)?(a) [‘h’, ‘e’, ‘l’, ‘l’, ‘o’](b) [‘hello’](c) [‘llo’](d) [‘olleh’]This question was posed to me by my college director while I was bunking the class.This interesting question is from Lists in portion Lists & List Comprehension of Python

Answer»

Right answer is (a) [‘h’, ‘E’, ‘L’, ‘l’, ‘o’]

To explain I would say: EXECUTE in the shell to VERIFY.



Discussion

No Comment Found

Related InterviewSolutions