{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "beedec97",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-25T04:59:31.824628Z",
     "iopub.status.busy": "2026-10-25T04:59:31.824128Z",
     "iopub.status.idle": "2026-10-25T04:59:31.829628Z",
     "shell.execute_reply": "2026-10-25T04:59:31.829128Z"
    }
   },
   "outputs": [],
   "source": [
    "import csv\n",
    "from pathlib import Path\n",
    "rows=list(csv.DictReader(Path('orders.csv').open(encoding='utf-8')))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "c7175482",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-25T04:59:31.831129Z",
     "iopub.status.busy": "2026-10-25T04:59:31.831129Z",
     "iopub.status.idle": "2026-10-25T04:59:31.834128Z",
     "shell.execute_reply": "2026-10-25T04:59:31.833627Z"
    }
   },
   "outputs": [],
   "source": [
    "amounts=[int(r['amount']) for r in rows]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "444633b1",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-25T04:59:31.835630Z",
     "iopub.status.busy": "2026-10-25T04:59:31.835630Z",
     "iopub.status.idle": "2026-10-25T04:59:31.838602Z",
     "shell.execute_reply": "2026-10-25T04:59:31.838098Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "55\n"
     ]
    }
   ],
   "source": [
    "print(sum(amounts))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "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.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
