Python_Class_Notes
Python_Class_Notes
1. Introduction to Python
Python is a high-level, interpreted programming language known for its readability and simplicity.
Key features:
- Dynamically typed
- Interpreted
Example:
name = 'Alice'
age = 25
Control statements:
- while loops
Example:
def greet(name):
5. Object-Oriented Programming
Example:
class Animal:
self.name = name
def speak(self):
File operations:
data = f.read()
Exception handling:
try:
# risky code
Algorithms Class Notes
except Exception as e:
print(e)