1. Introduction to Python
History of Python: Python was created by Guido van Rossum and first released in 1991. It was
designed to emphasize code readability and simplicity.
Characteristics of Python: Python is an interpreted, high-level, general-purpose programming
language. It is known for its simplicity, versatility, and extensive libraries.
Structure of a Python Program: A Python program consists of functions, variables, and modules,
with indentation being crucial for defining code blocks.
2. Data Types and Variables in Python
Basic Data Types: Python supports data types like int (integer), float (floating-point), str (string), bool
(boolean), and list (array-like collection).
Variables: Variables in Python are dynamically typed and do not require explicit declaration of data
types.
Constants and Literals: Python does not have built-in constant types but uses naming conventions
for variables that should not change.
3. Operators in Python
Arithmetic Operators: Includes +, -, *, /, % for performing basic arithmetic.
Relational Operators: Used to compare values, such as ==, !=, >, <.
Logical Operators: Logical operations include and, or, not.
Assignment and Miscellaneous Operators: Assignment uses = to assign values, and other operators
include is, in, etc.
4. Control Structures in Python
if, if-else, and elif statements: Used for conditional execution of code blocks.
Loops: Python supports for and while loops for repetitive execution of code blocks.
List Comprehensions: A concise way to create lists using loops and conditional expressions.
5. Functions in Python