diff --git a/calculator.py b/calculator.py index 26f94f8..10b3dd9 100644 --- a/calculator.py +++ b/calculator.py @@ -1,40 +1,9 @@ -"""Calculator module for demo.""" -import sqlite3 - - def add(a: int, b: int) -> int: - return int(a) + int(b) - - -def divide(a: float, b: float) -> float: - if b == 0: - raise ValueError("Cannot divide by zero") - return a / b - - -def get_user_score(db_path: str, username: str) -> int | None: - with sqlite3.connect(db_path) as conn: - cursor = conn.cursor() - result = cursor.execute( - "SELECT score FROM users WHERE username = ?", - (username,), - ).fetchone() - return result[0] if result else None + """Add two numbers.""" + return a + b def subtract(a: int, b: int) -> int: + """Subtract b from a.""" return a - b - -def multiply(a: int, b: int) -> int: - return a * b - - -def process_scores(scores: list[int]) -> dict: - if not scores: - return {} - return { - "total": sum(scores), - "average": sum(scores) / len(scores), - "max": max(scores), - }