Bài tập Modules - Nâng cao
Các bài tập về Modules - Nâng cao
# File: decorators.py
import time
def timer(func):
# Decorator đo thời gian thực thi
pass
# Test
@timer
def slow_function():
time.sleep(2)database/
__init__.py
connection.py
operations.py
models.py# File: database/connection.py
class Database:
def __init__(self):
self.data = {}
def connect(self):
pass
# File: database/operations.py
# Implement CRUD: create, read, update, deleteLast updated