Interview Q&A / Python

BeginnerQuick answer1 min readUpdated 3 Oct 2026

What are the main built-in data types in Python?

SHORT ANSWER

Numbers (int, float, complex, bool), text (str), sequences (list, tuple, range), mappings (dict), sets (set, frozenset), bytes types and NoneType. Lists, dicts and sets are mutable; the rest are immutable.

Explain it simply

Think of a stationery shop. A notebook (list) lets you add and tear out pages. A printed marksheet (tuple) is fixed once issued. A register that maps roll number to name is a dict. A bag of unique raffle tickets is a set. Python ships all of these ready to use.

The groups to remember:

  • Numeric: int, float, complex, and bool (a subclass of int)
  • Text: str
  • Sequences: list, tuple, range
  • Mapping: dict
  • Sets: set, frozenset
  • Binary: bytes, bytearray
  • Nothing: NoneType (the value None)

Example

python
print(type(7))            # Output: <class 'int'>
print(type(7.0))          # Output: <class 'float'>
print(type("7"))          # Output: <class 'str'>
print(type([7]))          # Output: <class 'list'>
print(type((7,)))         # Output: <class 'tuple'>
print(type({7: "seven"})) # Output: <class 'dict'>
print(type({7}))          # Output: <class 'set'>
print(isinstance(True, int))  # Output: True

What to say in the interview

"Python has numeric types, str, the sequence types list, tuple and range, dict for key-value data, set and frozenset, bytes types and None. list, dict, set and bytearray are mutable; int, float, str, tuple, frozenset and bytes are immutable. bool is a subclass of int, so True equals 1."

Common mistakes

  • Calling {} an empty set. It creates an empty dict; use set().

#python#data-types

Related questions

Practise more Python questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Python quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.