Python Tutorial · Revision notes

Python MCQ

Multiple-choice practice for Python: core syntax and operators, lists and data structures, object-oriented programming, file handling and common interview traps. Each question has a one-line explanation so you learn from mistakes.

Quick revision

  • / returns float, // floors, ** is right-associative.
  • and/or return operands; non-empty strings are truthy.
  • List assignment aliases; use copy/deepcopy to duplicate.
  • Mutable default arguments are shared; use None.
  • is=identity ,===equality .is = \text{identity}\ , == = \text{equality}\ .
  • File modes: r, w, a, x; with closes automatically.
  • MRO is child then parents left to right.
  • Lambdas in loops capture the variable, not the value.
Read the full Python MCQ notes on Doubtclip →