{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "382a9548",
   "metadata": {},
   "source": [
    "# 09-23 · Клуб и советчик погоды\n",
    "\n",
    "Практика к разделу [«Мини-проекты: клуб и погода»](../../site/chapters/glava-09/09-23-mini-proekt-klub-i-pogoda.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f2f8caab",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Собрать два мини-проекта на комбинирование условий."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4116a270",
   "metadata": {},
   "source": [
    "## Про input() в этом ноутбуке\n",
    "\n",
    "Этот ноутбук выполняется автоматически, без живого человека за клавиатурой — поэтому здесь `input()` временно подменён на заранее заготовленные ответы. Сам код с `input()` ниже выглядит и работает точно так же, как в обычном файле."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "df6c96bb",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T17:23:13.147189Z",
     "iopub.status.busy": "2026-08-16T17:23:13.147053Z",
     "iopub.status.idle": "2026-08-16T17:23:13.165162Z",
     "shell.execute_reply": "2026-08-16T17:23:13.164853Z"
    }
   },
   "outputs": [],
   "source": [
    "_answers = iter(['20', 'да'])\n",
    "\n",
    "def input(prompt=\"\"):\n",
    "    answer = next(_answers)\n",
    "    print(prompt + answer)\n",
    "    return answer"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0f694537",
   "metadata": {},
   "source": [
    "## Рабочий пример — клуб"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "f3e2c4f7",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T17:23:13.166580Z",
     "iopub.status.busy": "2026-08-16T17:23:13.166464Z",
     "iopub.status.idle": "2026-08-16T17:23:13.168876Z",
     "shell.execute_reply": "2026-08-16T17:23:13.168465Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ваш возраст: 20\n",
      "У вас есть билет? (да/нет): да\n",
      "True\n"
     ]
    }
   ],
   "source": [
    "age = int(input(\"Ваш возраст: \"))\n",
    "has_ticket = input(\"У вас есть билет? (да/нет): \").strip().lower() == \"да\"\n",
    "club_access = age >= 18 and has_ticket\n",
    "print(club_access)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9600e2d6",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика — советчик погоды\n",
    "\n",
    "Постройте рекомендацию по погоде для temperature = 5, is_raining = True."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "45426fdf",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T17:23:13.169948Z",
     "iopub.status.busy": "2026-08-16T17:23:13.169843Z",
     "iopub.status.idle": "2026-08-16T17:23:13.172269Z",
     "shell.execute_reply": "2026-08-16T17:23:13.171860Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "тёплая куртка и зонт\n"
     ]
    }
   ],
   "source": [
    "temperature = 5\n",
    "is_raining = True\n",
    "if temperature < 10 and is_raining:\n",
    "    advice = \"тёплая куртка и зонт\"\n",
    "elif temperature < 10:\n",
    "    advice = \"тёплая куртка\"\n",
    "elif is_raining:\n",
    "    advice = \"просто зонт\"\n",
    "else:\n",
    "    advice = \"лёгкая одежда\"\n",
    "print(advice)"
   ]
  }
 ],
 "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
}
