{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "d2b23b57",
   "metadata": {},
   "source": [
    "# 13-24 · Тестируем функцию\n",
    "\n",
    "Практика к разделу [«Тестируем функции»](../../site/chapters/glava-13/13-24-testirovanie-funkcij.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "403f0d00",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Проверить функцию через assert на нескольких примерах."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9a076594",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "396dab2e",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-17T18:54:18.852408Z",
     "iopub.status.busy": "2026-08-17T18:54:18.852246Z",
     "iopub.status.idle": "2026-08-17T18:54:18.872881Z",
     "shell.execute_reply": "2026-08-17T18:54:18.872447Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True\n"
     ]
    }
   ],
   "source": [
    "def classify_score(score):\n",
    "    if score >= 90:\n",
    "        return \"отлично\"\n",
    "    elif score >= 70:\n",
    "        return \"хорошо\"\n",
    "    else:\n",
    "        return \"пересдача\"\n",
    "\n",
    "assert classify_score(95) == \"отлично\"\n",
    "assert classify_score(75) == \"хорошо\"\n",
    "assert classify_score(50) == \"пересдача\"\n",
    "tests_passed = True\n",
    "print(tests_passed)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Cartesian Python 3.14",
   "language": "python",
   "name": "cartesian-python314"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.14.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
