Comprehensive Python Notes v2
Comprehensive Python Notes v2
1. Introduction to Python
Python is a high-level, interpreted programming language known for its readability and
simplicity. It supports multiple programming paradigms including procedural,
object-oriented, and functional programming.
Features:
- Easy to learn and use
- Extensive standard libraries
- Portable and cross-platform
- Large community support
2. Python Basics
Example:
x = 10
name = 'Alice'
is_active = True
Input/Output:
name = input('Enter your name: ')
print(f'Hello, {name}!')
3. Operators
Types of Operators:
- Arithmetic (+, -, *, /, %, //, **)
- Comparison (==, !=, >, <, >=, <=)
- Logical (and, or, not)
Example:
a = 10
b = 3
Comprehensive Python Notes
print(a + b) # 13
print(a > b and b < 5) # True