Interview Q&A / Python

INTERVIEW Q&A · 81 QUESTIONS

Python interview questions

Lists, dictionaries, generators, decorators and the Python questions asked in service-company and data roles.

  1. What are the common set operations in Python, and what is a frozenset?

    Sets support union (|), intersection (&), difference (-) and symmetric difference (^). A set holds unique, hashable items with fast membership tests. A frozenset is an immutable set, so it can be a dict key or a set element.

    BeginnerQuick answer1 min read