diff --git a/.ipynb_checkpoints/Week9-checkpoint.ipynb b/.ipynb_checkpoints/Week9-checkpoint.ipynb new file mode 100644 index 0000000..d68ec6a --- /dev/null +++ b/.ipynb_checkpoints/Week9-checkpoint.ipynb @@ -0,0 +1,92 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 8, + "id": "e074a0c8", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "7 시간 36분\n" + ] + } + ], + "source": [ + "\n", + "totalTime = 456;\n", + "print(f\"{int(totalTime / 60)} 시간 {int(totalTime % 60)}분\")\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "id": "75fc3091", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('김철수', 2.8)\n", + "김철수 : 2.8\n", + "이영희 : 3.9\n", + "임꺽정 : 4.0\n", + "홍길동 : 3.4\n" + ] + }, + { + "data": { + "text/plain": [ + "[None, None, None, None]" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a = {\"홍길동\" : 3.4, \"임꺽정\" : 4.0, \"김철수\" : 2.8, \"이영희\" : 3.9}\n", + "#, \"임꺽정\" : 4.0, \"김철수\" : 2.8, \"이영희\" : 3.9\n", + "print(sorted(a.items())[0])\n", + "b = list(sorted(a.items())[0])\n", + "\n", + "\n", + "[print(key, \":\", value) for (key, value) in b]\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7d7f589b", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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.8.8" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Week9.ipynb b/Week9.ipynb new file mode 100644 index 0000000..b9ff576 --- /dev/null +++ b/Week9.ipynb @@ -0,0 +1,92 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 8, + "id": "7b18fb2f", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "7 시간 36분\n" + ] + } + ], + "source": [ + "\n", + "totalTime = 456;\n", + "print(f\"{int(totalTime / 60)} 시간 {int(totalTime % 60)}분\")\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "id": "7af4aefa", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('김철수', 2.8)\n", + "김철수 : 2.8\n", + "이영희 : 3.9\n", + "임꺽정 : 4.0\n", + "홍길동 : 3.4\n" + ] + }, + { + "data": { + "text/plain": [ + "[None, None, None, None]" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a = {\"홍길동\" : 3.4, \"임꺽정\" : 4.0, \"김철수\" : 2.8, \"이영희\" : 3.9}\n", + "#, \"임꺽정\" : 4.0, \"김철수\" : 2.8, \"이영희\" : 3.9\n", + "print(sorted(a.items())[0])\n", + "b = sorted(a.items())\n", + "\n", + "\n", + "[print(key, \":\", value) for (key, value) in b]\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b0f315b6", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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.8.8" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}