list() — Python Technical Interview Questions & Answers

list()

list()

  • list() is built into Python. You do not import it. Freshers only need one honest call and the printed result — not a long definition.
  • list() — output: ['A', 's', 'h', 'a']. String → list of chars.
  • Wrong type often raises TypeError. Empty values matter for bool/all/any. Don’t mix list up with a similar name (sorted vs sort, int vs float).
  index →  0       1       2
  list  → [Asha,  Ravi,  Neha]

Technical Interview Tip: Call list() once and say what prints.

Code Examples for list()

Example

# list()
print(list("Asha"))

list() — output: ['A', 's', 'h', 'a']. String → list of chars.

How to Explain list() to an Interviewer

Explain list() as if you are teaching a junior — definition, then one tiny script.

list() is built-in — no import. One call + exact output.

What does the example print, and why?

list() — output: ['A', 's', 'h', 'a']

What mistake do freshers make with list()?

Wrong type → TypeError.