def percentage(total: float, obtained: float) -> float:
    """Return percentage of obtained marks."""
    if total <= 0:
        raise ValueError("Total marks must be greater than 0")
    return (obtained / total) * 100


def grade(score: float) -> str:
    """Return grade based on score."""
    if score >= 90:
        return "A+"
    elif score >= 80:
        return "A"
    elif score >= 70:
        return "B"
    elif score >= 60:
        return "C"
    elif score >= 50:
        return "D"
    else:
        return "F"
