Interview Question

What are data types in Python?

Every Python object has a type.

💡 Concept ✅ Quick Revision 🐍 Python

Answer

Python objects have types that define their supported operations and behavior. • Built-in types include numbers, strings, lists, tuples, ranges, dictionaries, sets, bytes, and booleans. • type() returns an object’s type. • isinstance() is usually better when checking a type relationship.

💡 Simple Example

value = [1, 2, 3] print(type(value).__name__) print(isinstance(value, list))

Output

list True

⚡ Quick Revision

Every Python object has a type.