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 is None in Python and how is it different from 0, False or an empty string?

    None is a special singleton object of type NoneType that means no value. It is falsy like 0, False and '', but it is not equal to any of them. Functions without a return statement return None, and you should test for it with is None.

    BeginnerQuick answer1 min read