From a4c0e63ff37df3bd7871c126c34b7c911a17cfe3 Mon Sep 17 00:00:00 2001 From: kitget <101336845+kitget@users.noreply.github.com> Date: Mon, 29 Jan 2024 22:27:34 +0900 Subject: [PATCH] =?UTF-8?q?Colaboratory=EB=A5=BC=20=ED=86=B5=ED=95=B4=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=EB=90=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Chapter1.ipynb | 520 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 520 insertions(+) create mode 100644 Chapter1.ipynb diff --git a/Chapter1.ipynb b/Chapter1.ipynb new file mode 100644 index 0000000..b6c7b92 --- /dev/null +++ b/Chapter1.ipynb @@ -0,0 +1,520 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [], + "authorship_tag": "ABX9TyOSNhmuCdOIjxLs53TNmzcw", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "markdown", + "source": [ + "데이터 입출력\n" + ], + "metadata": { + "id": "FQpl51OgXPQJ" + } + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "KRguNSCNW-C2", + "outputId": "fc0fb4ee-6b3b-413b-e0c6-98f43033db9a" + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "3" + ] + }, + "metadata": {}, + "execution_count": 1 + } + ], + "source": [ + "1+2" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# 변수 저장\n", + "변수명 = 할당할 변수값이며\n", + "변수는 어떤 값을 저장하는 주소\n", + "변수는 원하는 값을 다시 저장할 수 있으며\n", + "후에 저장된것이 최종 저장 값" + ], + "metadata": { + "id": "5v7EWkMCXb1-" + } + }, + { + "cell_type": "code", + "source": [ + "var1=5" + ], + "metadata": { + "id": "p34eJYTdXMU4" + }, + "execution_count": 2, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var1" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "WgRxk2ltXbRH", + "outputId": "3e049c21-6123-47e2-f300-d5884d44cd7b" + }, + "execution_count": 3, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "5" + ] + }, + "metadata": {}, + "execution_count": 3 + } + ] + }, + { + "cell_type": "code", + "source": [ + "var1=10\n", + "var1" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "7y11Pu_RXtdU", + "outputId": "bfb221d6-6a09-4a53-eec4-fb211f763eed" + }, + "execution_count": 4, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "10" + ] + }, + "metadata": {}, + "execution_count": 4 + } + ] + }, + { + "cell_type": "code", + "source": [ + "var2=20" + ], + "metadata": { + "id": "gjID0v90XwKN" + }, + "execution_count": 6, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var3=var1+var2\n", + "var3" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "usWG_E62X8Pm", + "outputId": "91a82a18-d28b-4a6c-df12-e4feff1e1eeb" + }, + "execution_count": 7, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "30" + ] + }, + "metadata": {}, + "execution_count": 7 + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(var3)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "RUZOECfXYChs", + "outputId": "90ceb42d-af8f-4c0a-af13-a074faffc03e" + }, + "execution_count": 9, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "30\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "#자료형\n", + "\n", + "*type(변수명)으로 변수의 형을 확인할 수 있다.\n", + "\n", + "숫자형\n", + "\n", + "\n", + "1. int(정수형) -자연수, 정수\n", + "2. float(실수형) - 소수점\n", + "\n", + "문자열\n", + "\n", + "\n", + "1. String(문자열) - 문자들의 집합\n", + "\n", + "\n" + ], + "metadata": { + "id": "OlXODoW_YLzz" + } + }, + { + "cell_type": "code", + "source": [ + "var1=10\n", + "type(var1)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "1gqQbKcPYa6X", + "outputId": "24d38734-b58b-4c89-96a1-077dc547a396" + }, + "execution_count": 10, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "int" + ] + }, + "metadata": {}, + "execution_count": 10 + } + ] + }, + { + "cell_type": "code", + "source": [ + " var2=3.14\n", + " type(var2)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "e1abjh2PYf94", + "outputId": "d4d65eb0-9c40-47da-e91c-941c4af5e30c" + }, + "execution_count": 11, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "float" + ] + }, + "metadata": {}, + "execution_count": 11 + } + ] + }, + { + "cell_type": "code", + "source": [ + "str1=\"Easy\"\n", + "str1" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 35 + }, + "id": "UepmMR4XYxJR", + "outputId": "ba619126-5576-49c8-b95c-c0e53b111ebf" + }, + "execution_count": 12, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'Easy'" + ], + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + } + }, + "metadata": {}, + "execution_count": 12 + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(type(str1))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "QVR2OuI8ZHeX", + "outputId": "63af0877-35cf-40d6-a7dc-4732ed9da581" + }, + "execution_count": 13, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "len(str1)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "itK2Ve_dZMn7", + "outputId": "5d09f64e-7076-40a3-f391-f9b2eee43b71" + }, + "execution_count": 14, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "4" + ] + }, + "metadata": {}, + "execution_count": 14 + } + ] + }, + { + "cell_type": "code", + "source": [ + "str1[0]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 35 + }, + "id": "yjwmdMzBZRHm", + "outputId": "371dc174-01b5-44b3-edb9-c21b41178d02" + }, + "execution_count": 15, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'E'" + ], + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + } + }, + "metadata": {}, + "execution_count": 15 + } + ] + }, + { + "cell_type": "code", + "source": [ + "str1[3]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 35 + }, + "id": "z_3GunsSZV9T", + "outputId": "51e024c3-4389-4359-d7da-093b21c34efb" + }, + "execution_count": 16, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'y'" + ], + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + } + }, + "metadata": {}, + "execution_count": 16 + } + ] + }, + { + "cell_type": "code", + "source": [ + "str1[-1]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 35 + }, + "id": "Rs6liloBZYz0", + "outputId": "92dc40de-b4aa-4f7a-f8ca-e68a3c664fcb" + }, + "execution_count": 17, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'y'" + ], + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + } + }, + "metadata": {}, + "execution_count": 17 + } + ] + }, + { + "cell_type": "code", + "source": [ + "str1[-4]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 35 + }, + "id": "RLyStYbuZdv0", + "outputId": "b3fd0be4-9fb6-4be0-d2b5-ffadbc22a187" + }, + "execution_count": 19, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'E'" + ], + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + } + }, + "metadata": {}, + "execution_count": 19 + } + ] + }, + { + "cell_type": "code", + "source": [ + "str1[0:3]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 35 + }, + "id": "Kgr8W9kXZf7Z", + "outputId": "54600ec9-ed91-43c6-f884-aa308cee1cbf" + }, + "execution_count": 20, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'Eas'" + ], + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + } + }, + "metadata": {}, + "execution_count": 20 + } + ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "7XvWLmMeZkfA" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file