{ "cells": [ { "cell_type": "markdown", "id": "intro", "metadata": {}, "source": [ "# Task summary\n", "\n", "Counts the sample tasks by status." ] }, { "cell_type": "code", "id": "setup", "metadata": {}, "source": [ "%load_ext autoreload\n", "!python --version" ], "execution_count": null, "outputs": [] }, { "cell_type": "code", "id": "counts", "metadata": {}, "source": [ "from collections import Counter\n", "\n", "tasks = [(\"write docs\", \"done\"), (\"fix bug\", \"open\"), (\"review\", \"open\")]\n", "counts = Counter(status for _, status in tasks)\n", "counts" ], "execution_count": null, "outputs": [] }, { "cell_type": "code", "id": "report", "metadata": {}, "source": [ "for status, n in sorted(counts.items()):\n", " print(f\"{status}: {n}\")" ], "execution_count": null, "outputs": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 5 }