Exam MCQ 2 — Python Technical Interview Questions & Answers
Exam MCQ 2
Exam MCQ 2
- MCQs test exact output and tiny traps: indent, == vs =, list vs tuple, mutable default args, is vs ==.
- How to practise: read the snippet, write the output on paper, then run. If wrong, note the trap. That is better than mugging 200 random questions.
- Exam MCQ 2 — output: False, True, True. Empty list is falsy; [0] is truthy.
Technical Interview Tip: Dry-run on paper before you look at options.
Code Examples for Exam MCQ 2
Example
# Exam MCQ 2
print(bool([]))
print(bool([0]))
print("Asha" == "Asha")
Exam MCQ 2 — output: False, True, True. Empty list is falsy; [0] is truthy.
How to Explain Exam MCQ 2 to an Interviewer
Explain Exam MCQ 2 as if you are teaching a junior — definition, then one tiny script.
MCQs test exact output and tiny traps: indent, == vs =, list vs tuple, mutable default args, is vs ==. How to practise: read the snippet, write the output on paper, then run.
What does the example print, and why?
Exam MCQ 2 — output: False, True, True
What mistake do freshers make with Exam MCQ 2?
MCQs test exact output and tiny traps: indent, == vs =, list vs tuple, mutable default args, is vs ==.