Python Basics: Key Concepts & Interview Q&A
✅ 1. What is Python?
Python is a high-level, interpreted, and object-oriented programming
language. It’s known for its simple syntax, readability, and broad range
of applications (web, data science, automation, etc.).
✅ 2. Features of Python
Easy to learn & use
Interpreted & dynamically typed
Cross-platform
Extensive libraries (NumPy, Pandas, Django, etc.)
Supports OOP, functional, and procedural programming
✅ 3. Python Keywords and Identifiers
Keywords: if, else, for, while, def, class, True, False, etc.
Identifiers: Variable/function/class names. Must not start with a digit
or use special characters.
✅ 4. Variables and Data Types
Python is dynamically typed — no need to declare data types.
x=5 # int
name = "John" # str
pi = 3.14 # float
is_valid = True # bool
Common types:
int, float, str, bool, list, tuple, set, dict
✅ 5. Operators
Arithmetic: +, -, *, /, %, //, **
Comparison: ==, !=, <, >, <=, >=
Logical: and, or, not
Assignment: =, +=, -=, etc.
Membership: in, not in
Identity: is, is not