<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>shrimp_park.log</title>
        <link>https://velog.io/</link>
        <description>최고의 데이터 분석가를 목표로 하는 박세우입니다.</description>
        <lastBuildDate>Tue, 23 Jan 2024 13:05:56 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>shrimp_park.log</title>
            <url>https://velog.velcdn.com/images/shrimp_park/profile/bf9dc7ac-794f-4c97-885c-d572c89ddafe/social_profile.png</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. shrimp_park.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/shrimp_park" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[[제로베이스 데이터 분석 스쿨 2기] SQL (feat. AWS RDS, SQL File, Database Backup, Database Restore, Table Backup, Table Restore, Table Schema Backup)]]></title>
            <link>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-SQL-feat.-AWS-RDS-SQL-File-Database-Backup-Database-Restore-Table-Backup-Table-Restore-Table-Schema-Backup</link>
            <guid>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-SQL-feat.-AWS-RDS-SQL-File-Database-Backup-Database-Restore-Table-Backup-Table-Restore-Table-Schema-Backup</guid>
            <pubDate>Tue, 23 Jan 2024 13:05:56 GMT</pubDate>
            <description><![CDATA[<h3 id="aws-rds-amazon-relational-database-service">AWS RDS (Amazon Relational Database Service)</h3>
<p>AWS에서 제공하는 관계형 데이터베이스 서비스</p>
<h4 id="aws-rds-접속">AWS RDS 접속</h4>
<p>터미널에서
mysql -h &lt;엔드포인트&gt; -P &lt;포트&gt; -u &lt;유저이름&gt; -p</p>
<h3 id="sql-file">SQL File</h3>
<p>SQL FILE이란, SQL 쿼리를 모아 놓은 파일</p>
<h4 id="실행-방법-1-mysql-로그인-후">실행 방법 1. mysql 로그인 후</h4>
<p>(1) source 파일경로/파일이름.sql
(2) . 파일경로/파일이름.sql (source 대신 . 사용 가능)
(3) . 파일이름.sql (파일이 있는 폴더를 사용중인 경우)</p>
<h4 id="실행방법-2-외부에서-바로-실행">실행방법 2. 외부에서 바로 실행</h4>
<p>mysql -u username -p dbname &lt; 파일경로/파일이름.sql</p>
<h3 id="database-backup">Database Backup</h3>
<h4 id="특정-db-백업">특정 DB 백업</h4>
<p>SQL File로 Database를 백업할 수 있다.
mysqldump -u username -p dbname &gt; backup.sql</p>
<h4 id="모든-db-백업">모든 DB 백업</h4>
<p>mysqldump -u username -p --all-databases &gt; backup.sql</p>
<p>예시) zerobase 백업
mysqldump -u root -p zerobase &gt; zerobase.sql</p>
<h3 id="database-restore">Database Restore</h3>
<p>데이터베이스를 백업한 SQL File을 실행하여 그 시점으로 복구하거나 이전 할 수 있다.
실행 방법 - source name.sql</p>
<h3 id="table-backup">Table Backup</h3>
<p>Table 단위 백업
mysqldump -u username -p dbname tablename &gt;backup.sql</p>
<p>예시) # celeb 테이블 백업
mysqldump -u root -p zerobase celeb &gt; celeb.sql</p>
<h3 id="table-restore">Table Restore</h3>
<p>Table을 백업한 파일을 실행하여, 해당 테이블을 복구하거나 이전할 수 있다.
SQL File을 실행하는 방법과 동일함</p>
<h3 id="table-schema-backup">Table Schema Backup</h3>
<p>데이터를 제외하고 테이블 생성 쿼리만 백업할 수 있다.</p>
<h4 id="특정-table-schema-backup">특정 Table Schema Backup</h4>
<p>mysqldump -d -u username -p dbname tablename &gt; backup.sql</p>
<h4 id="모든-table-schema-backup">모든 Table Schema Backup</h4>
<p>mysqldump -d -u username -p dbname &gt; backup.sql</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[제로베이스 데이터 분석 스쿨 2기] SQL (feat. Union, Join, Concat, Alias, Distinct, Limit)]]></title>
            <link>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-SQL-feat.-Union-Join-Concat-Alias-Distinct-Limit</link>
            <guid>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-SQL-feat.-Union-Join-Concat-Alias-Distinct-Limit</guid>
            <pubDate>Tue, 23 Jan 2024 12:58:38 GMT</pubDate>
            <description><![CDATA[<h3 id="union">Union</h3>
<p>여러 개의 SQL문을 합쳐서 하나의 SQL 문으로 만들어주는 방법 (주의, 칼럼의 개수가 같아야함)</p>
<p>Union: 중복된 값을 제거하여 알려준다.
Union ALL: 중복된 값도 모두 보여준다.</p>
<p>select col1, col2 from table A
Union | Union ALL
select col1, col2 from table B;</p>
<h3 id="join">Join</h3>
<p>두 개 이상의 테이블을 결합하는 것</p>
<p><img src="https://velog.velcdn.com/images/shrimp_park/post/260d2e3b-22d9-4d77-b48a-8ef215dfb8a3/image.PNG" alt=""> 출처 - 제로베이스</p>
<h4 id="inner-join">Inner join</h4>
<p>두 개의 테이블에서 공통된 요소들을 통해 결합하는 조인방식</p>
<p>select col1, col2, ...
from tableA
inner join tableB
on tableA.column = tableB.column
where condition;</p>
<pre><code>select celeb.id, celeb.name, snlshow.id, snlshow.host
from celeb
inner join snlshow
on celeb.name = snlshow.host;</code></pre><p><img src="https://velog.velcdn.com/images/shrimp_park/post/9e5f3231-46cd-495d-aa8c-52ef4feb628e/image.PNG" alt=""></p>
<h4 id="left-join">Left join</h4>
<p>두 개의 테이블에서 공통영역을 포함해 왼쪽 테이블의 다른 대이터를 포함하는 조인방식</p>
<p>select col1, col2, ...
from tableA
left join tableB
on tableA.column = tableB.column
where condition;</p>
<pre><code>select celeb.id, celeb.name, snlshow.id, snlshow.host
from celeb
left join snlshow
on celeb.name = snlshow.host;</code></pre><p><img src="https://velog.velcdn.com/images/shrimp_park/post/916d5583-769e-4eb7-9ffc-2ce1bdb97701/image.PNG" alt=""></p>
<h4 id="right-join">Right join</h4>
<p>두 개의 테이블에서 공통영역을 포함해 오른쪽 테이블의 다른 데이터를 포함하는 조인방식</p>
<p>select col1, col2, ...
from tableA
right join tableB
on tableA.column = tableB.column
where condition;</p>
<pre><code>select celeb.id, celeb.name, snlshow.id, snlshow.host
from celeb
right join snlshow
on celeb.name = snlshow.host;</code></pre><p><img src="https://velog.velcdn.com/images/shrimp_park/post/955ca281-35b1-4d95-a957-66dd958fcd05/image.PNG" alt=""></p>
<h4 id="full-outer-join">Full outer join</h4>
<p>두 개의 테이블에서 공통영역을 포함하여 양쪽 테이블의 다른 영역을 모두 포함하는 조인방식 (MySQL에서 지원 안함)</p>
<p>select col1, col2, ...
from tableA
full outer join tableB
on tableA.column = tableB.column
where condition;</p>
<p>MySQL에서는 FULL JOIN을 지원하지 않으므로 다음의 쿼리로 같은 결과를 만들 수 있다.</p>
<pre><code>select col1, col2, ...
from tableA
left join tableB
on tableA.column = tableB.column

UNION

select col1, col2, ...
from tableA
right join tableB
on tableA.column = tableB.column
where conditionl</code></pre><p><img src="https://velog.velcdn.com/images/shrimp_park/post/d47595dc-e23b-4a00-8c5e-e32b217a6b1b/image.PNG" alt=""></p>
<h3 id="self-join">self join</h3>
<p>가장 많이 사용되는 방식, inner join과 같은 결과 -&gt; join되는 테이블 간의 공통된 데이터를 가져옴</p>
<p>select col1, col2, ...
from tableA, tableB
where condition (tableA.col1 = tableB.col2);</p>
<p><img src="https://velog.velcdn.com/images/shrimp_park/post/5313b051-fcb1-4f37-8077-865adf3b0356/image.PNG" alt=""></p>
<h3 id="concat">Concat</h3>
<p>여러 문자열을 하나로 합치거나 연결
select concat(&#39;string1&#39; , &#39;string2&#39;) from tablename;</p>
<p>예제
select concat(&#39;이름: &#39;, name) from celeb
<img src="https://velog.velcdn.com/images/shrimp_park/post/76e9f4c9-98c9-45e6-84eb-7896b4e63c53/image.PNG" alt=""></p>
<h3 id="alias">Alias</h3>
<p>컬럼이나 테이블 이름에 별칭 생성</p>
<p>ALIAS 문법1- Column
select column as alias from tablename;</p>
<p>예제 1) 
select name as &#39;이름&#39; from celeb;
<img src="https://velog.velcdn.com/images/shrimp_park/post/8373e321-c0c2-47f3-8004-6d305398aae5/image.PNG" alt=""></p>
<p>ALIAS 문법2- Table select column1 , column2
from tablename as alias</p>
<p>예제2) 
select name as &#39;이름&#39;, agency as &#39;소속사&#39; from celeb;
<img src="https://velog.velcdn.com/images/shrimp_park/post/dfa4408c-8656-40d9-9f50-78a523f36dca/image.PNG" alt=""></p>
<p>예시3) name과 job_title을 합쳐서 profile 이라는 별칭 만들어서 검색</p>
<p>select concat(name, &#39; : &#39;, job_title) as profile from celeb;
<img src="https://velog.velcdn.com/images/shrimp_park/post/9d36df08-4154-427a-a89e-8be2d8858b70/image.PNG" alt=""></p>
<p>예제4) snl_show에 출연한 celeb을 기준으로 두 테이블을 조인하여, celeb 테이블을 c, snl_show는 s라는 별칭을 만들어서 출연한 시즌과 에피소드, 이름, 직업을 검색</p>
<p>select s.season, s.episode,c.name, c.job_title
from celeb as c, snlshow as s
where c.name = s.host;
<img src="https://velog.velcdn.com/images/shrimp_park/post/a7947870-e9aa-45ed-bdde-f7490034aff9/image.PNG" alt=""></p>
<h3 id="distinct">Distinct</h3>
<p>검색한 결과의 중복 제거
select distinct column1, column2
from tablename;</p>
<p>예제1) #연예인 소속사 종류를 검색 - 중복 제외
<img src="https://velog.velcdn.com/images/shrimp_park/post/3944c20a-cb8c-47ce-b7da-00f91ddf6ce2/image.PNG" alt=""></p>
<h3 id="limit">Limit</h3>
<p>검색결과를 정렬된 순으로 주어진 숫자만큼 조회
select column1, column2,...
from tablename
where condition
limit number;</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[Python 기초 - 리스트[], 튜플(), 딕셔너리{}]]></title>
            <link>https://velog.io/@shrimp_park/Python-%EA%B8%B0%EC%B4%88-%EB%A6%AC%EC%8A%A4%ED%8A%B8-%ED%8A%9C%ED%94%8C-%EB%94%95%EC%85%94%EB%84%88%EB%A6%AC</link>
            <guid>https://velog.io/@shrimp_park/Python-%EA%B8%B0%EC%B4%88-%EB%A6%AC%EC%8A%A4%ED%8A%B8-%ED%8A%9C%ED%94%8C-%EB%94%95%EC%85%94%EB%84%88%EB%A6%AC</guid>
            <pubDate>Sun, 21 Jan 2024 15:01:58 GMT</pubDate>
            <description><![CDATA[<h3 id="리스트란">리스트란?</h3>
<ul>
<li>요소들의 모음을 나타내는 자료형</li>
<li>요소들을 대괄호([])로 감싸주어 만들 수 있습니다.</li>
<li>모든 자료형을 리스트의 요소로 담을 수 있습니다.</li>
</ul>
<h4 id="리스트-함수">리스트 함수</h4>
<p>len: 리스트의 길이를 구함.</p>
<pre><code>a = [1,2,3,4,5]
len(a)
깂 = 5</code></pre><p>sum, min, max: 리스트 요소들의 합, 최솟값, 최댓값을 구함.</p>
<pre><code>sum(a)/len(a)
값 = 3.0</code></pre><p>in: 특정 요소가 리스트 안에 있는지 확인</p>
<pre><code>a = [&#39;a&#39;,&#39;b&#39;,&#39;c&#39;,&#39;d&#39;,&#39;e&#39;]
&#39;a&#39; in a
값 = True</code></pre><p>append: 리스트의 맨 마지막에 요소를 추가</p>
<pre><code>a = [1,2,3]
a.append(4)
print(a) #[1,2,3,4]</code></pre><p>extend: 리스트의 맨 마지막에 다른 리스트를 추가</p>
<pre><code>a = [1,2,3]
a.extend([4,5])
print(a) #[1, 2, 3, 4, 5]</code></pre><p>insert: 리스트의 특정 위치에 특정 요소를 삽입</p>
<pre><code>a = [1,2,3,4]
a.insert(3,2) #4 번째 자리에 &#39;2&#39; 추가 -&gt; 
print(a) # [1,2,3,2,4]</code></pre><p>remove, pop: 리스트의 요소를 삭제</p>
<pre><code>#remove: 특정 요소를 제거
a = [1,2,3,4]
print(a)
a.remove(4) #&#39;4&#39;제거
print(a) #[1,2,3]

#pop: 특정 위치의 요소를 제거하여 그 요소를 반환
a.pop(2) #3 번째 위치인 3을 반환
print(a) # [1.2]
</code></pre><p>count: 리스트의 특정 요소의 개수를 반환</p>
<pre><code>a = [1,1,2,3]
a.count(1) #&#39;1&#39;이 리스트안에 2개 있음 -&gt; 값 = 2
</code></pre><p>index: 리스트에 요소가 있는 경우 인덱스 값을 반환</p>
<pre><code>a = [&#39;a&#39;,&#39;b&#39;,1,2]
a.index(1) #2</code></pre><p>sort, sorted, reverse: 리스트를 정렬</p>
<pre><code>#sort: 정렬된 리스트를 변환
a = [1,20,23,2]
a.sort()
print(a) #[1,2,20,23[]

#sorted: 정렬된 리스트를 출력만 함 (리스트 자체 변경x)
a = [1,20,23,2]
sorted(a) #[1,2,20,23]

print(a) #리스트 변경 x -&gt; [1,20,23,2]

#내림차순으로 바꾸고 싶은 경우
a = [1,20,23,2]
sorted(a, reverse=True) #[23, 20, 2, 1]

#오름차순으로 바꾸고 싶은 경우
a = [1,20,23,2]
sorted(a, reverse=False) #[1, 2, 20, 23]
</code></pre><p>join: 리스트의 요소들을 하나의 문자열로 함침 (문자일 경우만 사용 가능)</p>
<pre><code>a = [&#39;a&#39;,&#39;b&#39;,&#39;c&#39;,&#39;d&#39;,&#39;e&#39;]
print(&#39;-&#39;.join(a)) #a-b-c-d-e
print(&#39;/&#39;.join(a)) #a/b/c/d/e
print(&#39;&#39;.join(a)) #abcde
</code></pre><p>split: 문자영을 리스트의 요소들로 쪼갭니다. </p>
<pre><code>a = &#39;a b c d e&#39;
a.split() #공백을 기준으로 split -&gt;[&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;, &#39;e&#39;]

a = &#39;a,b,c,d,e&#39;
a.split(&#39;,&#39;) #&#39;,&#39;를 기준으로 split -&gt; [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;, &#39;e&#39;]</code></pre><h3 id="튜플">튜플</h3>
<h4 id="튜플이란">튜플이란?</h4>
<ul>
<li>리스트와 비슷하게 여러 요소들을 묶을 수 있습니다.</li>
<li>다만 튜플의 요소는 수정이나 삭제가 불가능합니다. (값 치환 불가능)</li>
<li>프로그램 실행 중 절대 변하지 않거나 변해서는 안되는 값들이 있다면 튜플로 저장하는 것이 좋습니다.</li>
<li>요소들을 괄호(())로 감싸주면 튜플이 됩니다.</li>
</ul>
<h4 id="튜플-함수">튜플 함수</h4>
<ul>
<li>len: 튜플의 길이를 구합니다.</li>
<li>sum, min, max: 튜플의 요소들의 합, 최솟값, 최댓값을 구합니다.</li>
<li>in: 특정 요소가 튜플 안에 있는지 확인합니다.</li>
<li>count: 튜플의 특정 요소의 개수를 반환합니다.</li>
<li>index: 튜플에 요소가 있는 경우 인덱스 값을 반환합니다.</li>
<li>join: 튜플의 요소들을 하나의 문자열로 합칩니다.</li>
</ul>
<h4 id="튜플-함수-심화">튜플 함수 심화</h4>
<ul>
<li>max(튜플, key = lambda x:x[인덱스]) : 다중 튜플의 경우 정렬 기준을 정의하여 튜플 내 최댓값을 탐색함</li>
<li>min(튜플, key = lambda x:x[인덱스]) : 다중 튜플의 경우 정렬 기준을 정의하여 튜플 내 최솟값을 탐색함<pre><code>a = ((&#39;a&#39;, 1), (&#39;b&#39;,7), (&#39;c&#39;, 3), (&#39;d&#39;, -5), (&#39;e&#39;, -9))
print(max(a, key = lambda x:x[0])) #인덱스 0인 a (문자)를 기준으로 최댓값 탐색
print(max(a, key = lambda x:x[1])) #인덱스 1인 1 (숫자)를 기준으로 최댓값 탐색
</code></pre></li>
</ul>
<p>print(min(a, key = lambda x:x[0]))인덱스 0인 a (문자)를 기준으로 최솟값 탐색
print(min(a, key = lambda x:x[1]))인덱스 0인 a (문자)를 기준으로 최솟값 탐색</p>
<p>#두번째 요소의 절댓값을 기준으로 최댓값/최솟값을 탐색하고 싶다면?
print(max(a, key = lambda x:abs(x[1]))) #(&#39;e&#39;, -9)
print(min(a, key = lambda x:abs(x[1]))) #(&#39;a&#39;, 1)</p>
<pre><code>
### 딕셔너리
#### 딕셔너리란? 
* 키(Key): 값(Value)의 쌍이 모여있는 사전 형태의 자료형입니다.
* 키: 값의 쌍을 중괄호({})로 감싸줍니다.
* 변수명 = {&#39;키1&#39;:값, &#39;키2&#39;:값, ...}
* 키는 중복될 수 없고, 리스트는 키가 될 수 없습니다.
위치로 인덱싱이 되지 않습니다.</code></pre><p>dic = {&#39;name&#39;:&#39;merry&#39;,<br>      &#39;num&#39;:1,<br>      &#39;birth&#39;:&#39;jan&#39;}
dic # output
{&#39;name&#39;: &#39;merry&#39;, &#39;num&#39;: 1, &#39;birth&#39;: &#39;jan&#39;}</p>
<pre><code>#### 딕셔너리 요소 추가, 삭제하기
추가: 딕셔너리변수명[추가할키]=추가할값</code></pre><p>print(dic) #{&#39;name&#39;: [&#39;merry&#39;, &#39;john&#39;], &#39;num&#39;: [1, 2, 3], &#39;birth&#39;: [&#39;jan&#39;, &#39;feb&#39;, &#39;nov&#39;]
dic[&#39;country&#39;] = [&#39;Korea&#39;,&#39;US&#39;]
print(dic) #{&#39;name&#39;: [&#39;merry&#39;, &#39;john&#39;], &#39;num&#39;: [1, 2, 3], &#39;birth&#39;: [&#39;jan&#39;, &#39;feb&#39;, &#39;nov&#39;], &#39;country&#39;: [&#39;Korea&#39;, &#39;US&#39;]}</p>
<pre><code>
삭제: del 딕셔너리변수명[삭제할키]</code></pre><p>del dic[&#39;country&#39;]
print(dic) #{&#39;name&#39;: [&#39;merry&#39;, &#39;john&#39;], &#39;num&#39;: [1, 2, 3], &#39;birth&#39;: [&#39;jan&#39;, &#39;feb&#39;, &#39;nov&#39;]}</p>
<pre><code>#### 딕셔너리 키로 값 찾기
딕셔너리변수명[찾을키]</code></pre><p>print(dic[&#39;name&#39;]) #[&#39;merry&#39;, &#39;john&#39;]
print(dic[&#39;num&#39;]) #[1, 2, 3]</p>
<pre><code>#### 딕셔너리 함수
keys(): 키들을 반환합니다.
values(): 값들을 반환합니다.
items(): 키와 값의 튜플 쌍들을 반환합니다.</code></pre><p>dic #{&#39;name&#39;: [&#39;merry&#39;, &#39;john&#39;], &#39;num&#39;: [1, 2, 3], &#39;birth&#39;: [&#39;jan&#39;, &#39;feb&#39;, &#39;nov&#39;]}</p>
<p>print(dic.keys()) #dict_keys([&#39;name&#39;, &#39;num&#39;, &#39;birth&#39;])</p>
<p>print(dic.values()) #dict_values([[&#39;merry&#39;, &#39;john&#39;, &#39;kevin&#39;], [1, 2, 3], [&#39;jan&#39;, &#39;feb&#39;, &#39;nov&#39;]])</p>
<p>print(dic.items())#dict_items([(&#39;name&#39;, [&#39;merry&#39;, &#39;john&#39;, &#39;kevin&#39;]), (&#39;num&#39;, [1, 2, 3]), (&#39;birth&#39;, [&#39;jan&#39;, &#39;feb&#39;, &#39;nov&#39;])])
#위의 값들의 타입은 dict_keys or values ,or items라는 유니크한 값을 가짐. 따라서 리스트의 형태로 변환하고 싶으면 list()함수로 감싸줘야됨.</p>
<pre><code>get(원하는키값): 원하는 키 값에 대응되는 값을 반환합니다.
딕셔너리변수명[원하는키값]과 똑같은 값을 반환합니다.</code></pre><p>dic.get(&#39;name&#39;)#[&#39;merry&#39;, &#39;john&#39;]
dic[&#39;name&#39;] #위와 같은 값 </p>
<pre><code>update: 딕셔너리에 새로운 딕셔너리를 추가합니다.</code></pre><p>dic1 = {&#39;a&#39;:[1,2], &#39;b&#39;:3, &#39;c&#39;:[4,5,6]}
dic2 = {&#39;d&#39;:10, &#39;e&#39;:[102,101]}
dic1.update(dic2)
dic1 #{&#39;a&#39;: [1, 2], &#39;b&#39;: 3, &#39;c&#39;: [4, 5, 6], &#39;d&#39;: 10, &#39;e&#39;: [102, 101]}</p>
<pre><code>zip: 튜플/리스트 두 개를 하나의 딕셔너리로 변환합니다.</code></pre><p>keys = (&quot;a&quot;, &quot;b&quot;)
values = (1,2)
result = dict(zip(keys, values))
print(result) #{&#39;a&#39;: 1, &#39;b&#39;: 2}</p>
<p>keys = [&quot;a&quot;, &quot;b&quot;]
values = [1,2]
result = dict(zip(keys, values))
print(result) #{&#39;a&#39;: 1, &#39;b&#39;: 2}</p>
<pre><code></code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[제로베이스 데이터 분석 스쿨 2기] SQL (feat. 정의, User 관리, User 권한 관리, Table 생성, Table 변경&삭제,  SELECT, WHERE, UPDATE, DELETE, ORDER BY, Logical operators) ]]></title>
            <link>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-SQL-feat.-%EC%A0%95%EC%9D%98-User-%EA%B4%80%EB%A6%AC-User-%EA%B6%8C%ED%95%9C-%EA%B4%80%EB%A6%AC-Table-Table-SELECT-WHERE-UPDATE-DELETE-ORDER-BY-Logical-operators</link>
            <guid>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-SQL-feat.-%EC%A0%95%EC%9D%98-User-%EA%B4%80%EB%A6%AC-User-%EA%B6%8C%ED%95%9C-%EA%B4%80%EB%A6%AC-Table-Table-SELECT-WHERE-UPDATE-DELETE-ORDER-BY-Logical-operators</guid>
            <pubDate>Fri, 19 Jan 2024 14:22:55 GMT</pubDate>
            <description><![CDATA[<h3 id="database">Database</h3>
<p>주요 용어들</p>
<p>database란, 여러 사람이 공유하여 사용할 목적으로 체계화해 통합, 관리하는 데이터의 집합체</p>
<p>DBMS 란 (Database Management System), 사용자와 데이터베이스 사이에서 사용자의 요구에 따라 정보를 생성해주고 데이터베이스를 관리해주는 소프트웨어</p>
<p>관계형 데이터 베이스란 (RDB: Relational Database), 서로간에 관계가 있는 데이터 테이블들을 모아둔 데이터 저장공간</p>
<h3 id="sql">SQL</h3>
<p>SQL이란, 데이터베이스에서 데이터를 정의, 조작, 제어하기 위해 사용하는 언어</p>
<h4 id="sql-구성">SQL 구성</h4>
<p>데이터 정의 언어(DDL: Data Definition Language)
-CREAT, ALTER, DROP 등의 명령어</p>
<p>데이터 제어 언어 (DLC: Data Control Languages)
-GRANT, REVOKE, COMMIT, ROLLBACK 등의 명령어</p>
<h3 id="database-관리">Database 관리</h3>
<p>CREAT - 데이터 베이스 생성
ex)CREATE DATABASE testdb;</p>
<p>USE - 해당 데이터베이스로 이동
ex) USE testdb;</p>
<p>DROP - 데이터베이스 삭제
ex) DROP DATABASE dbname;</p>
<h3 id="user-관리">User 관리</h3>
<p>User 생성 - localhost (현재 PC에서 접근 가능한 계정)
현재 PC에서만 접속 가능한 사용자를 비밀번호화 함께 생성
CREAT USER &#39;username&#39;@&#39;localhost&#39; identified by &#39;password&#39;;</p>
<p>현재 PC에서 접근 가능한 계정 삭제
DROP USER &#39;noma&#39;@&#39;localhost&#39;</p>
<p>User 생성 - % (외부에서 접속 가능)
CREAT USER &#39;username&#39;@%&#39;localhost&#39; identified by &#39;password&#39;;</p>
<p>외부 유저 계정 삭제
DROP USER &#39;noma&#39;@&#39;%&#39;</p>
<h3 id="user권한-관리">User권한 관리</h3>
<p><strong>user 권한 확인</strong>
사용자에게 부여된 모든 권한 목록을 확인
SHOW GRANTS FOR &#39;username&#39;@&#39;localhost&#39;;</p>
<p><strong>사용자에게 특정 데이터베이스의 모든 권한을 부여</strong>
GRANT ALL ON dbname.* to &#39;username&#39;@&#39;localhost&#39;;</p>
<p><strong>사용자에게 특정 데이터베이스의 모든 권한을 삭제</strong>
REVOKE ALL ON dbname.* from &#39;username&#39;@&#39;localhost&#39;;</p>
<h3 id="table">Table</h3>
<p>Table이란, 데이터베이스 안에서 실제 데이터가 저장되는 형태이고, 행(row)과 열(column)로 구성된 데이터 모음</p>
<p><strong>Table 생성</strong>
create table tablename
(column datatype, column datatype);</p>
<p><strong>Table 목록 확인 문법</strong>
show tables;</p>
<p><strong>Table 정보 확인 문법 (description)</strong>
desc tablename;</p>
<p><strong>Table 이름 변경</strong>
alter table tablename
rename new_table;</p>
<p><strong>Table Column 추가</strong>
alter table tablename
add column columnname datatype;</p>
<p><strong>Table Column 데이터타입 변경</strong>
alter table tablename
modify column columnname datatype;</p>
<p><strong>Table Column 이름 변경</strong>
alter table tablename
chage column old_columnname, new_columnname, new_datatype;</p>
<p><strong>Table Column 삭제</strong>
alter table tablename
drop column columnname;</p>
<p><strong>insert - 데이터를 추가하는 명령어</strong>
입력한 컬럼 이름의 순서와 값의 순서가 일치하도록 주의!
insert into tablename (col1, col2,...)
values (value1, value2,....);</p>
<p><strong>모든 컬럼값을 추가하는 경우</strong>
모든 컬럼값을 추가하는 경우에는 다음과 같이 컬럼 이름을 지정하지 않아도 되지만, 입력하는 값의 순서가 테이블의 컬럼 순서와 일치하도록 주의!
insert into tablename
values (val1, val2, ...);</p>
<p><strong>select - 데이터를 조회하는 명령어</strong>
태이블 내의 특정 칼럼에 대한 데이터를 조회
select column1, column2, ...
from tablename;</p>
<p><strong>테이블 내의 모든 컬럼에 대한 데이터를 조회하는 경우</strong>
select *
from tablename;</p>
<p><strong>where - 테이블 내에서 조건을 만족하는 데이터 조회</strong>
select column1, column2, ...
from tablename
where condition;</p>
<p><strong>update - 데이터를 수정하는 명령어</strong>
update tablename
set column1 = value1, column2 = value 2, ...
where condition;</p>
<p><strong>delete - 데이터를 삭제하는 명령어</strong>
delete from tablename
where condition;</p>
<p><strong>order by - select 문에서 데이터를 특정 컬럼을 기준으로 오름차순 혹은 내림차순 정렬</strong>
asc (Ascending): 오름차순 정렬
desc(descending): 내림차순 정렬</p>
<p>select col1, col2
from tablename
order by col1, col2, acs | desc;</p>
<h3 id="logical-operators">Logical operators</h3>
<p><strong>And 문법</strong>
조건을 모두 만족하는 경우 True
select col1, col2
from tablename
where condition1 AND condition2 ..</p>
<p><strong>OR 문법</strong>
하나의 조건이라도 만족하는 경우 TRUE
select col1, col2
from tablename
where condition1 or condition2 ..</p>
<p><strong>NOT 문법</strong>
조건을 만족하지 않는 경우 True
select col1, col2
from tablename
where not condition</p>
<p><strong>Between 문법</strong>
조건값이 범위 사위에 있으면 True
select col1, col2
from tablename
where col1 BETWEEN value1 AND value2;</p>
<p><strong>In 문법</strong>
목록 안에 조건이 존재하는 경우 True
select col1, col2
from tablename
where column IN (value1, value2);</p>
<p><strong>Like 문법</strong>
조건값이 패턴에 맞으면 True
select col1, col2
from tablename
where column like pettern;</p>
<pre><code>#소속사 이름이 &#39;YG엔터테이먼트&#39;인 데이터  검색
select * from celeb where agency like &#39;YG엔터테이먼트&#39;;

#&#39;YG&#39;로 시작하는 소속사 이름을 가진 데이터 검색
select * from celeb where agency like &#39;YG%&#39;;

#&#39;엔터테이먼트&#39;로 끝나는 소속사 이름을 가진 데이터를 검색
select * from celeb where agency like &#39;%엔터테이먼트&#39;;

#직업명에 &#39;가수&#39;가 포함된 데이터를 검색
select * from celeb where job_title like &#39;%가수%&#39;;

#소속사 이름의 두 번째 글자가 G인 데이터를 검색
select * from celeb where agency like &#39;_G%&#39;;

#직업명이 &#39;가&#39;로 시작하고 최소 2글자 이상인 데이터 검색
select * from celeb job_title like &#39;가_%&#39;;


#직업명이 &#39;가&#39;로 시작하고 최소 5글자 이상인 데이터 검색
select * from celeb job_title like &#39;가____%&#39;;

#직업명이 &#39;영&#39;으로 시작하고 &#39;모델&#39;로 끝나는 데이터 검색
select * from celeb where job_title like &#39;영%모델&#39;;



</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[[제로베이스 데이터 분석 스쿨 2기] Python(feat. 클래스, 객체와 메모리, 클래스 상속, 생성자, 다중 상속, 오버라이딩, 추상 클래스, 예외, Finally, exeption 클래스, raise, 텍스트 파일 (열기, 쓰기, 읽기), with ~as문, readlines()
, writelines())




]]></title>
            <link>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-Pythonfeat.-%ED%81%B4%EB%9E%98%EC%8A%A4-%EA%B0%9D%EC%B2%B4%EC%99%80-%EB%A9%94%EB%AA%A8%EB%A6%AC-%ED%81%B4%EB%9E%98%EC%8A%A4-%EC%83%81%EC%86%8D-%EC%83%9D%EC%84%B1%EC%9E%90-%EB%8B%A4%EC%A4%91-%EC%83%81%EC%86%8D-%EC%98%A4%EB%B2%84%EB%9D%BC%EC%9D%B4%EB%94%A9-%EC%B6%94%EC%83%81-%ED%81%B4%EB%9E%98%EC%8A%A4-%EC%98%88%EC%99%B8-Finally-exeption-%ED%81%B4%EB%9E%98%EC%8A%A4-raise-%ED%85%8D%EC%8A%A4%ED%8A%B8-%ED%8C%8C%EC%9D%BC-%EC%97%B4%EA%B8%B0-%EC%93%B0%EA%B8%B0-%EC%9D%BD%EA%B8%B0-%E3%85%87</link>
            <guid>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-Pythonfeat.-%ED%81%B4%EB%9E%98%EC%8A%A4-%EA%B0%9D%EC%B2%B4%EC%99%80-%EB%A9%94%EB%AA%A8%EB%A6%AC-%ED%81%B4%EB%9E%98%EC%8A%A4-%EC%83%81%EC%86%8D-%EC%83%9D%EC%84%B1%EC%9E%90-%EB%8B%A4%EC%A4%91-%EC%83%81%EC%86%8D-%EC%98%A4%EB%B2%84%EB%9D%BC%EC%9D%B4%EB%94%A9-%EC%B6%94%EC%83%81-%ED%81%B4%EB%9E%98%EC%8A%A4-%EC%98%88%EC%99%B8-Finally-exeption-%ED%81%B4%EB%9E%98%EC%8A%A4-raise-%ED%85%8D%EC%8A%A4%ED%8A%B8-%ED%8C%8C%EC%9D%BC-%EC%97%B4%EA%B8%B0-%EC%93%B0%EA%B8%B0-%EC%9D%BD%EA%B8%B0-%E3%85%87</guid>
            <pubDate>Thu, 18 Jan 2024 13:37:39 GMT</pubDate>
            <description><![CDATA[<h3 id="클래스">클래스</h3>
<p>용어 정리 (출처- <a href="https://youtu.be/FRHGtAvU03Q?si=WU-AqPXehcSQOAe6">https://youtu.be/FRHGtAvU03Q?si=WU-AqPXehcSQOAe6</a>)</p>
<p>클래스: 제품의 설계도
객체: 설계도로 만든 제품
속성: 클래스안의 변수
메서드: 클래스안의 함수
생성자: 객체를 만들 때 실행되는 함수
인스턴스: 메모리에 살아있는 객체</p>
<p><em>실습</em></p>
<pre><code>속성이 색, 길이, 무게를 가진 5가지의 다른 비행기 객체 만들기
class Airplane:
    def __init__(self, color, length, weight):
        self.color = color
        self.length = length
        self.weight = weight

    def take_off(self):
        print(&#39;take_off&#39;)

    def landing(self):
        print(&#39;landing&#39;)

    def print_plane_info(self):
        print(f&#39;flight\&#39;s color is {self.color}&#39;)
        print(f&#39;flight\&#39;s length is {self.length}&#39;)
        print(f&#39;flight\&#39;s weight is {self.weight}&#39;)

plane1 = Airplane(&#39;red&#39;, 200, 400)
plane2 = Airplane(&#39;blue&#39;, 210, 433)
plane3 = Airplane(&#39;white&#39;, 260, 4600)
plane4 = Airplane(&#39;orange&#39;, 240, 490)
plane5 = Airplane(&#39;black&#39;, 230, 404)

plane1.print_plane_info()
plane2.print_plane_info()
plane3.print_plane_info()
plane4.print_plane_info()
plane5.print_plane_info()</code></pre><h3 id="객체와-메모리">객체와 메모리</h3>
<p>변수는 객체의 메모리 주소를 저장하고 이를 이용해서 객체를 참조한다. </p>
<pre><code>class Robot:
  def __init__(self, color, height, weight):
    self.color = color
    self.height = height
    self.weight = weight

   def print_robot_infor(self):
    print(f&#39;color = {self.color}&#39;)
    print(f&#39;height = {self.height}&#39;)
    print(f&#39;weight = {self.weight}&#39;)

rb1 = Robot(&#39;red&#39;, 200, 88) #생성된 객체가 있는 메모리의 주소값이 rb1에 들어감
rb2 = Robot(&#39;blue&#39;, 230, 188)
rb3 = rb1 #rb3는 rb1이 가지고 있는 주소값이 카피된것. 즉, 하나의 객체를 공유

# rb1.print_robot_infor()
# rb2.print_robot_infor()
# rb3.print_robot_infor()

#속성 변경
rb1.color = &#39;gray&#39;
rb1.height = 3000
rb1.weight = 300000

rb1.print_robot_infor()
rb2.print_robot_infor()
rb3.print_robot_infor() #rb1과 같은 값을 나타냄</code></pre><h4 id="객체-복사에-대한-이해-얕은-복사와-깊은-복사">객체 복사에 대한 이해 (얕은 복사와 깊은 복사)</h4>
<p>얕은 복사란, 객체 주소를 복사하는 것으로 객체 자체가 복사되지 않는다. </p>
<pre><code>class TemCls:

  def __init__(self, n, s):
      self.number = n
      self.str = s

  def print_cls_info(self):
    print(f&#39;self.number: {self.number}&#39;)
    print(f&#39;self.str: {self.str}&#39;)

#얕은 복사
tc1 = TemCls(10, &#39;hello&#39;)
tc2 = tc1
#
# tc1.print_cls_info()
# tc2.print_cls_info()
tc2.number = 22
tc2.str = &#39;ddd&#39;

tc1.print_cls_info()
tc2.print_cls_info()</code></pre><p>깊은 복사
깊은 복사란, 객체 자체를 복사하는 것으로 또 하나의 객체가 만들어진다.</p>
<pre><code>
#깊은 복사
import copy

tc1 = TemCls(10, &#39;hello&#39;)
tc2 = copy.copy(tc1)#레퍼런스가 갖고 있는 객체를 복사. 즉, tc1이랑은 아예 다른 객체가 됨
tc2.str = &#39;www&#39;
tc2.number = 22

tc1.print_cls_info()
tc2.print_cls_info()#다른 속성을 가진 객체 정보가 출력</code></pre><p>다양한 깊은 복사 방법</p>
<ol>
<li>반복문 이용하기<pre><code>import copy
scores = [2,4,5,5,2,1,3]
scores_copy = []
</code></pre></li>
</ol>
<p>for s in scores:
    scores_copy.append(s)
    print(f&#39;id(scores): {id(scores)}&#39;)
    print(f&#39;id(scores_copy): {id(scores_copy)}&#39;) #서로 다른 값이 출력</p>
<pre><code>2. extend 이용하기</code></pre><p>scores_copy.extend(scores)
print(f&#39;id(scores): {id(scores)}&#39;)
print(f&#39;id(scores_copy): {id(scores_copy)}&#39;) #서로 다른 값이 출력</p>
<pre><code>3. 카피 이용하기</code></pre><p>scores_copy = scores.copy()
print(f&#39;id(scores): {id(scores)}&#39;)
print(f&#39;id(scores_copy): {id(scores_copy)}&#39;) #서로 다른 값이 출력</p>
<pre><code>
4. 리스트 슬라이싱 이용하기</code></pre><p>scores_copy = scores[:]#리스트 슬라이싱
print(f&#39;id(scores): {id(scores)}&#39;)
print(f&#39;id(scores_copy): {id(scores_copy)}&#39;) #서로 다른 값이 출력</p>
<pre><code>
_실습_</code></pre><p>선수의 원본 점수를 이용해서 평균을 출력하고, 최고값과 최저값을 제외한 평균을 출력하는 프로그램을 만들어보자.</p>
<p>player_original_score = [8.7, 9.1, 8.9, 9.0, 7.9, 9.5, 8.8, 8.3]
player_original_score.sort() #원본 점수 정렬</p>
<h1 id="printplayer_original_score-정렬-확인">print(player_original_score) #정렬 확인</h1>
<p>copy_score = player_original_score.copy() #복사본 만들기</p>
<h1 id="printcopy_score-복사본-확인">print(copy_score) #복사본 확인</h1>
<p>copy_score.sort() #복사본 정렬</p>
<h1 id="printcopy_score-정렬-확인">print(copy_score) #정렬 확인</h1>
<p>del copy_score[0] #복사본의 최솟값 제거
del copy_score[-1] #복사본의 최댓값 제거</p>
<h1 id="printcopy_score-제거-확인">print(copy_score) #제거 확인</h1>
<p>print(f&#39;player original score is: {player_original_score}&#39;)
print(f&#39;player copy score is: {copy_score}&#39;)</p>
<p>original_total = round(sum(player_original_score),2) #원본 점수 총합 소수 둘 째자리까지 저장
original_avg = round(original_total/len(player_original_score),2) #원본 평균 점수 소수 둘 째자리까지 저장
print(f&#39;original total score is {original_total}&#39;)
print(f&#39;original avg score is {original_avg}&#39;)</p>
<p>copy_total = round(sum(copy_score),2) #복사본 점수 총합 소수 둘 째자리까지 저장
copy_avg = round(original_total/len(copy_score),2) #원본과의 평균 비교를 위해 원본의 총합/ 복사본의 수 (6)
print(f&#39;copy total score is {copy_total}&#39;)
print(f&#39;copy avg score is {copy_avg}&#39;)</p>
<p>print(f&#39;original avg - copy avg is {original_avg - copy_avg}&#39;)</p>
<p>#결과
player original score is: [7.9, 8.3, 8.7, 8.8, 8.9, 9.0, 9.1, 9.5]
player copy score is: [8.3, 8.7, 8.8, 8.9, 9.0, 9.1]
original total score is 70.2
original avg score is 8.78
copy total score is 52.8
copy avg score is 11.7
original avg - copy avg is -2.92</p>
<pre><code>
### 클래스 상속
클래스는 또 다른 클래스를 상속해서 내 것처럼 사용할 수 있다. </code></pre><p>class Normal_car:</p>
<p>def drive(self):
print(&#39;{normal_car} drive() called!&#39;)</p>
<p>def back(self):
print(&#39;{normal_car] back() called!&#39;)</p>
<p>class Turbo_car(Normal_car): #Turbo_car 클래스가 Normal_car를 상속</p>
<p>def turbo(self):
print(&#39;{turbo_car} turbo() called!&#39;)</p>
<p>my_turbo_car = Turbo_car()</p>
<p>my_turbo_car.turbo()
#Turbo_car 클래스가 Normal_car를 상속했기 때문에 back과 drive 둘 다 사용 가능.
my_turbo_car.back()
my_turbo_car.drive()</p>
<pre><code>_실습_</code></pre><p>덧셈, 뺄셈 기능이 있는 클래스를 만들고, 이를 상속하는 클래스를 만들어서 곱셈과 나눗셈 기능을 추가해 보자.</p>
<p>class Calculator_super:
def add(self, n1, n2):
return n1 + n2
def sub(self, n1, n2):
return n1 - n2</p>
<p>class Caculator_child(Calculator_super):
def multi(self, n1, n2):
return n1 * n2</p>
<p>def div(self, n1, n2):
return n1 / n2</p>
<p>my_calculator = Caculator_child()</p>
<p>print(f&#39;add: {my_calculator.add(10,20)}&#39;)
print(f&#39;sub: {my_calculator.sub(10,20)}&#39;)
print(f&#39;multiply: {my_calculator.multi(10,20)}&#39;)
print(f&#39;divide: {my_calculator.div(10,20)}&#39;)</p>
<pre><code>### 생성자
객체가 생성될 때 호출하면 ____int____()가 자동으로 호출된다.
____int____()가 속성을 초기화 한다.</code></pre><p>class Calculator():
    def <strong>init</strong>(self, n1, n2):
        print(&#39;[Calculator]<strong>inti</strong>() called!&#39;)
        self.num1 = n1
        self.num2 = n2
cal = Calculator(10,20) #속성 초기화
print(f&#39;num1: {cal.num1}&#39;)
print(f&#39;num2: {cal.num2}&#39;)</p>
<pre><code>양식 업데이트를 위한 super():</code></pre><p>class P_Class:</p>
<pre><code>def __init__(self, pnum1, pnum2):
    print(&#39;[P_Class] __init__() called!&#39;)

    self.pnum1 = pnum1
    self.pnum2 = pnum2</code></pre><p>class C_Class(P_Class):</p>
<pre><code>def __init__(self, cnum1, cnum2): #위 P_Class의 속성이 사라짐
    print(&#39;[C_Class] __init__() called!&#39;)

        super().__init__(cnum1,cnum2) #P_Class의 속성을 상속하기 위해선 super(). 사용. 즉, 그 전(P_Class)의 내용을 가져옴

    self.cnum1 = cnum1
    self.cnum2 = cnum2</code></pre><p>cls = C_Class(10, 20)</p>
<p>print(f&#39;cls.cNum1: {cls.cNum1}&#39;)
print(f&#39;cls.cNum2: {cls.cNum2}&#39;)</p>
<p>print(f&#39;cls.pNum1: {cls.pNum1}&#39;)
print(f&#39;cls.pNum2: {cls.pNum2}&#39;)</p>
<pre><code>_실습_</code></pre><p>중간고사 클래스와 기말고사 클래스를 상속관계로 만들고 각각의 점수를 초기화하자. 또한 총점 및 평균을 반환하는 기능도 만들어보자.</p>
<p>class MidExam:</p>
<pre><code>def __init__(self, s1, s2, s3):
    print(&#39;[MidExam] __init__()&#39;)

      self.mid_kor_score = s1
      self.mid_eng_score = s2
      self.mid_math_score = s3

def print_score(self):
      print(f&#39;mid_kor_score is {self.mid_kor_score}&#39;)
      print(f&#39;mid_eng_score is {self.mid_eng_score}&#39;)
      print(f&#39;mid_math_score is {self.mid_math_score}&#39;)</code></pre><p>class FinalExam(MidExam):</p>
<pre><code>def __init__(self, s1, s2, s3, s4, s5, s6):

    super().__init__(s1, s2, s3)

    self.final_kor_score = s4
    self.final_eng_score = s5
    self.final_math_score = s6

def print_score(self):
    super().print_score()
    print(f&#39;final_kor_score is {self.final_kor_score}&#39;)
    print(f&#39;final_eng_score is {self.final_eng_score}&#39;)
    print(f&#39;final_math_score is {self.final_math_score}&#39;)

def get_total_score(self):
    total = self.mid_kor_score + self.mid_eng_score +                 self.mid_math_score + self.final_math_score

    total += self.final_kor_score + self.final_eng_score                     
    return total</code></pre><h1 id="return-selfmid_kor_score--selfmid_eng_score--selfmid_math_score--">return self.mid_kor_score + self.mid_eng_score + self.mid_math_score + \</h1>
<h1 id="selffinal_kor_score--selffinal_eng_score--selffinal_math_score">self.final_kor_score + self.final_eng_score + self.final_math_score</h1>
<pre><code>def get_avg(self):
    return self.get_total_score()/6</code></pre><p>exam = FinalExam(33, 55, 99, 44, 59, 88)
exam.print_score()
print(f&#39;total score: {exam.get_total_score()}&#39;)
print(f&#39;total score: {exam.get_avg()}&#39;)</p>
<pre><code>### 다중 상속
2개 이상의 클래스를 상속하는 것.</code></pre><p>class Car01:
    def drive(self):
        print(&#39;drive() method called&#39;)</p>
<p>class Car02:
    def turbo(self):
        print(&#39;turbo() method called&#39;)</p>
<p>class Car03:
    def fly(self):
        print(&#39;fly() method called&#39;)</p>
<p>class Car (Car01, Car02, Car03):
    def <strong>init</strong>(self):
    pass</p>
<p>my_car = Car()
my_car.drive()
my_car.fly()
my_car.turbo()</p>
<pre><code>_실습_</code></pre><p>BasicCalculator와 DeveloperCalculator 클래스를 다음과 같이 만들고 이들 클래스를 상속해서 Calculator 클래스를 만들고 사용해보자.
class BasicCalculator:</p>
<pre><code>def add(self, n1, n2):
    return n1 + n2

def sub(self, n1, n2):
    return n1 - n2

def mul(self, n1, n2):
    return n1 * n2

def div(self, n1, n2):
    return n1 / n2</code></pre><p>class DeveloperCalculator:</p>
<pre><code>def mod(self, n1, n2):
    return n1 % n2

def flo(self, n1, n2):
    return n1 // n2

def exp(self, n1, n2):
    return n1 ** n2</code></pre><p>class Caculator(BasicCalculator, DeveloperCalculator):
    def <strong>init</strong>(self):
        pass</p>
<p>cal = Caculator()
print(cal.flo(10, 20))
print(cal.add(10, 20))
print(cal.sub(10, 20))
print(cal.mul(10, 20))
print(cal.mod(10, 20))
print(cal.exp(10, 20))</p>
<pre><code>### 오버라이딩
하위 클래스에서 상위 클래스의 매서드를 재정의 한다.</code></pre><p>class Robot:</p>
<pre><code>def __init__(self, c, h, w):
  self.color = c
  self.height = h
  self.weight = w

def fire(self):
    print(&#39;미사일 발사!&#39;)

def print_Robot_info(self):
  print(f&#39;self.color = {self.color}&#39;)
  print(f&#39;self.height = {self.height}&#39;)
  print(f&#39;self.weight = {self.weight}&#39;)</code></pre><p>class New_Robot(Robot):</p>
<pre><code>def __init__(self, c, h, w):
    super().__init__(c,h,w)

def fire(self): #fire 재정의 (override)
    #super().fire()
    print(&#39;레이저 발사&#39;)

my_robot.fire()
    my_robot = New_Robot(&#39;red&#39;, 100, 200)
    my_robot.print_Robot_info()</code></pre><pre><code>_실습_</code></pre><p>삼각형 넓이를 계산하는 클래스를 만들고 이를 상속하는 클래스에서 get_triangle_area()를 오버라이딩 해서 출력 결과가 다음과 같을 수 있도록 클래스를 만들어보자.</p>
<p>class Triangle_Area:
    def <strong>init</strong>(self, w, h):
      self.width = w
      self.height = h</p>
<pre><code>def print_triangle_info(self):
  print(f&#39;triangle width : {self.width}&#39;)
  print(f&#39;triangle height : {self.height}&#39;)

def get_traingle_area(self):
    return self.width * self.height/ 2</code></pre><p>class New_Triangle_Area(Triangle_Area):</p>
<pre><code>def __init__(self, w, h):
    super().__init__(w,h)

def get_traingle_area(self):
    return str(super().get_traingle_area()) + &#39;㎠&#39;</code></pre><p>ta = New_Triangle_Area(20, 4)
ta.print_triangle_info()
ta_area = ta.get_traingle_area()</p>
<p>print(f&#39;area: {ta_area}&#39;)</p>
<pre><code>### 추상클래스
상위 클래스에서 하위 클래으세 메서드 구현을 강요한다.</code></pre><p>from abc import ABCMeta
from abc import abstractmethod</p>
<p>class AirPlane(metaclass=ABCMeta):</p>
<pre><code>@abstractmethod #강제로 구현해야 되는 메소드 위에 붙여줌줌
def flight(self): #AirPlane을 상속하기 위해서는 이 부분을 구현해서 써야됨
    pass

def forward(self):
    print(&#39;전진!&#39;)

def backward(self):
    print(&#39;후진!&#39;)</code></pre><p>class Airliner(AirPlane):</p>
<pre><code>def __init__(self, c):
    self.color = c

def flight(self):
    print(&#39;시속 300km/h 비행&#39;)</code></pre><p>al = Airliner(&#39;White&#39;)
al.forward()
al.backward()
al.flight()</p>
<pre><code>_실습_</code></pre><p>계산기 추상 클래스를 만들고 이를 이용해서 새로운 계산기 클래스를 만들어보자. 추상 클래스에는 덧셈, 뺄셈, 곱셈, 나눗셈 기능이 선언되어 있어야 한다.</p>
<p>from abc import ABCMeta
from abc import abstractmethod</p>
<p>class Calculator(metaclass= ABCMeta):</p>
<pre><code>@abstractmethod
def add(self,n1,n2):
    pass

@abstractmethod
def sub(self, n1, n2):
    pass

@abstractmethod
def multi(self, n1, n2):
    pass

@abstractmethod
def div(self,n1,n2):
    pass</code></pre><p>class DevelopCalculator(Calculator):</p>
<pre><code>def add(self,n1,n2):
    print(n1 + n2)

def sub(self,n1,n2):
    print(n1 - n2)

def multi(self,n1,n2):
    print(n1 * n2)

def div(self,n1,n2):
    print(n1 / n2)

def mod(self, n1,n2):
    print(n1 % n2)

def flo(self, n1, n2):
    print(n1//n2)</code></pre><p>cal = DevelopCalculator()
cal.flo(10,20)
cal.mod(10,20)
cal.div(10,20)
cal.sub(10,20)
cal.multi(10,20)
cal.add(10,20)</p>
<pre><code>### 예외
예외란, 문법적인 문제는 없으나 실행 중 발생하는 예상하지 못한 문제이다.
ex) 어떤 수를 0으로 나눈 경우

#### 예외처리 (try~except)
발생된 예외를 별도 처리함으로써 프로그램 전체의 실행에 문제가 없도록 함.
예외 발생 예상 구문을 try~except로 감싼다.</code></pre><p>n1 = 10; n2 = 0</p>
<p>try:
    print(n1/n2)
except:
    print(&#39;예상치 못한 예외가 발생했습니다.&#39;)
    print(&#39;다른 프로그램 실행에는 문제 없습니다.&#39;)</p>
<p>print(n1 * n2)
print(n1 - n2)
print(n1 + n2)</p>
<pre><code>_실습_</code></pre><p>사용자로부터 숫자 5개를 입력 받을 때 숫자가 아닌 자료형이 입력되면 예외 처리하는 프로그램을 만들어보자.
nums = []</p>
<p>n = 1
while n &lt; 6:
    try:
        num = int(input(&#39;숫자 입력: &#39;))</p>
<pre><code>except:
    print(&#39;예외발생!&#39;)
    continue

    nums.append(num)
    n += 1
    print(nums)</code></pre><pre><code>예외가 발생하지 않았을 때 실행하는 구문 (try~except~else)
else는 try, except를 사용한 후에만 사용할 수 있다.</code></pre><p>nums = []
n =1
while n &lt; 6:</p>
<pre><code>try:
    num = int(input(&#39;input number: &#39;))

except:
    print(&#39;please type number.&#39;)
    continue

else:
    if num % 2 == 0:
        nums.append(num)
        n += 1
else:
    print(&#39;The number you typed is odd number.&#39;, end = &#39;&#39;)
    print(&#39;please type the numebr agian&#39;)
    continue</code></pre><p>print(f&#39;nums = {nums}&#39;)</p>
<pre><code>_실습_</code></pre><p>사용자로부터 숫자 5개를 입력받아 짝수, 홀수, 실수로 구분해서 각각을 리스트에 저장하는 프로그램을 만들어보자.
even_list = []; odd_list=[]; float_list = []</p>
<p>n = 1
while n &lt;6:</p>
<pre><code>try:
    number = float(input(&#39;type number: &#39;))
    n += 1
    except:
    print(&#39;please type number&#39;)
    continue

else:
    if number - int(number) != 0:
        print(&#39;it is a float number&#39;)
        float_list.append(number)

elif number % 2 == 0:
    print(&#39;its an even number&#39;)
    even_list.append(int(number))

else:
    print(&#39;it is an odd number&#39;)
    odd_list.append(int(number))</code></pre><p>print(f&#39;float list = {float_list}&#39;)
print(f&#39;even list = {even_list}&#39;)
print(f&#39;odd list = {odd_list}&#39;)</p>
<pre><code>### Finally, exeption 클래스, raise
Finally - 예외 발생과 상관없이 항상 실행한다.</code></pre><p>try:
    input_Data = input(&#39;input number: &#39;)
    num_int = int(input_Data)</p>
<p>except:
    print(&#39;plase tpye a number&#39;)</p>
<p>else:
    if num_int % 2 == 0:
        print(&#39;its an even number&#39;)
    else:
        print(&#39;its an odd number&#39;)</p>
<p>finally:
    print(f&#39;input data: {input_Data}&#39;)</p>
<pre><code>
Exception 클래스</code></pre><p>num1 = int(input(&#39;input num1: &#39;))
num2 = int(input(&#39;input num2: &#39;))</p>
<p>try:
    print(f&#39;num1 / num2 = {num1/num2}&#39;)
except Exception as e:
    print(f&#39;exepction: {e}&#39;) # print: exepction: division by     zero</p>
<p>print(f&#39;num1 + num2 = {num1 + num2}&#39;)
print(f&#39;num1 - num2 = {num1 - num2}&#39;)
print(f&#39;num1 * num2 = {num1 * num2}&#39;)</p>
<pre><code>
raise
raise 키워드를 이용하면 예외를 발생시킬 수 있다.</code></pre><p>def div_calculation(n1,n2):
    if n2 != 0:
        print(f&#39;{n1} / {n2} = {n1/n2}&#39;)
    else:
        raise Exception(&#39;0으로 나눌 수 없습니다.&#39;)</p>
<p>num1 = int(input(&#39;input number1: &#39;))
num2 = int(input(&#39;input number2: &#39;))</p>
<p>try:
    div_calculation(num1, num2)
    except Exception as e:
    print(f&#39;Exception: {e}&#39;)</p>
<pre><code>
_실습_</code></pre><p>사용자가 문자 메세지를 보낼 때 10글자 이하면 SMS로 발송하고, 10글자를 초과하면 MMS로 발송하는 프로그램을 예외 처리를 이용해서 만들어보자.
def sendSMS(msg):
    if len(msg) &gt; 10:
        raise Exception(&#39;길이초과! MMS로 전환 후 발송&#39;,1)
    else:
        print(&#39;SMS 발송&#39;)</p>
<p>def sendMMS (msg):
    if len(msg) &lt;= 10:
        raise Exception(&#39;길이 미달! SMS로 전환 후 발송&#39;,2)
    else:
        print(&#39;MMS 발송&#39;)</p>
<p>msg = input(&#39;input message: &#39;)</p>
<p>try:
    sendSMS(msg)
except Exception as e:
    print(f&#39;e: [e.args[0]&#39;)
    print(f&#39;e: [e.args[1]&#39;)</p>
<pre><code>if e.args[1] == 1:
    sendMMS(msg)
elif e.args[1] == 2:
    sendSMS(msg)</code></pre><pre><code>#### 사용자 예외 클래스
Exception 클래스를 상속해서 사용자 예외 클래스를 만들 수 있다.

_실습_</code></pre><p>관리자 암호를 입력하고 다음 상태에 따라 예외 처리하는 예외 클래스를 만들어보자.
class PasswordLengthShortExeption(Exception):
    def <strong>init</strong>(self,str):
        super().<strong>init</strong>(f&#39;{str}: 길이 5 미만&#39;)</p>
<p>class PasswordLengthLongExeption(Exception):
    def <strong>init</strong>(self,str):
        super().<strong>init</strong>(f&#39;{str}: 길이 10 초과&#39;)</p>
<p>class PasswordLengthWrongExeption(Exception):
    def <strong>init</strong>(self,str):
        super().<strong>init</strong>(f&#39;{str}: 잘못된 비밀번호&#39;)</p>
<p>adminPw = input(&#39;password: &#39;)</p>
<p>try:
    if len(adminPw) &lt; 5:
        raise PasswordLengthShortExeption(adminPw)</p>
<pre><code>elif len(adminPw) &gt; 10:
    raise PasswordLengthLongExeption(adminPw)

elif adminPw != &#39;admin1234&#39;:
    raise PasswordLengthWrongExeption(adminPw)

elif adminPw == &#39;admin1234&#39;:
    print(&#39;bingo!&#39;)</code></pre><p>except PasswordLengthShortExeption as e1:
        print(e1)</p>
<p>except PasswordLengthLongExeption as e2:
print(e2)</p>
<p>except PasswordLengthWrongExeption as e3:
print(e3)</p>
<pre><code>### 텍스트 파일 쓰기
#### 파일 열기 - open()</code></pre><p>file = open(&#39;C:/pythonTxt/test.txt&#39;,&#39;w&#39;) #/test.txt 파일 생성/ ,&#39;w&#39; -&gt; 쓰기모드
strCnt = file.write(dateStr + todaySchedule)
print(f&#39;strCnt: {strCnt}&#39;)</p>
<p>file.close()</p>
<pre><code>#### 읽기 또는 쓰기 - read() or write()</code></pre><p>#예시 1
file = open(&#39;C:/pythonTxt/test.txt&#39;,&#39;r&#39;)
str = file.read()
print(f&#39;str: {str}&#39;)</p>
<p>file.close()</p>
<pre><code></code></pre><p>예시 2
file = open(&#39;C:/pythonTxt/about_python.txt&#39;, &#39;r&#39;, encoding= &#39;UTF8&#39;)</p>
<p>str = file.read()
print(f&#39;str: {str}&#39;)
file.close()</p>
<p>str = str.replace(&#39;Python&#39;, &#39;파이썬&#39;, 2) #2개의 Python 문자를 파이썬으로 바꿈
print(f&#39;str: {str}&#39;)</p>
<p>with open(&#39;C:/pythonTxt/about_python.txt&#39;, &#39;w&#39;, encoding=&#39;utf-8&#39;) as f:</p>
<p>f.write(str)
f.close()</p>
<pre><code>
#### 파일 닫기 - close()

#### 텍스트파일 열기 모드
#&#39;w&#39;: 쓰기 전용 (파일이 있으면 덮어씌움)</code></pre><p>url = &#39;C:/pythonTxt/&#39;</p>
<p>file = open(url + &#39;hello.txt&#39;, &#39;w&#39;)
file.write(&#39;HELLO PYTHON&#39;)
file.close()</p>
<pre><code>#&#39;a&#39;: 쓰기 전용 (파일이 있으면 덧붙임)</code></pre><p>url = &#39;C:/pythonTxt/&#39;</p>
<p>file = open(url + &#39;hello.txt&#39;, &#39;a&#39;)
file.write(&#39;\nnice to meet you&#39;)
file.close()</p>
<pre><code>#&#39;x&#39;: 쓰기 전용 (파일이 있으면 에러 발생)</code></pre><p>url = &#39;C:/pythonTxt/&#39;</p>
<p>file = open(url + &#39;hello.txt&#39;, &#39;x&#39;)
file.write(&#39;\nnice to meet you&#39;)
file.close()</p>
<pre><code>#&#39;r&#39;: 읽기 전용 (파일이 없으면 에러 발생)</code></pre><p>url = &#39;C:/pythonTxt/&#39;</p>
<p>file = open(url + &#39;hello.txt&#39;, &#39;r&#39;)
str = file.read()
print(str)
file.close()</p>
<pre><code>_실습_</code></pre><p>사용자가 입력한 숫자에 대한 소수를 구하고 이를 파일에 작성해보자
url = &#39;C:/pythonTxt/&#39;</p>
<p>def write_prime_numers(n):
    file = open(url + &#39;prime_numbers.txt&#39;, &#39;a&#39;)
file.write(str(n))
file.write(&#39;\n&#39;)
file.close()</p>
<p>input_number = int(input(&#39;0보다 큰 정수 입력: &#39;))
for number in range(2,input_number + 1):
    flag = True
        for n in range(2, number + 1):
            if number % n == 0:
                flag = False
                    break</p>
<pre><code>        if flag:
            write_prime_numers(number)</code></pre><pre><code>### with ~ as 문
#읽기</code></pre><p>with open(url + &#39;5_036.txt&#39;, &#39;a&#39;) as f:
f.write(&#39;python study!&#39;)</p>
<pre><code>#쓰기</code></pre><p>with open(url + &#39;5_036.txt&#39;, &#39;r&#39;) as f:
print(f.read())</p>
<pre><code>_실습_</code></pre><p>로또 번호 생성기 프로그램을 만들고 파일에 번호를 출력해보자
import random</p>
<p>url = &#39;C:/pythonTxt/&#39;</p>
<p>def write_numbers(nums):
    for idx, num in enumerate(nums):
        with open(url + &#39;lotto_num.txt&#39;, &#39;a&#39;) as f:
        if idx &lt; len(nums) -2:
            f.write(str(num) + &#39;,&#39;)
        elif idx == len(nums) - 2:
            f.write(str(num) + &#39;,&#39;)
        elif idx == len(nums) - 1:
            f.write(&#39;\n&#39;)
            f.write(&#39;Bonus: &#39; + str(num))</p>
<p>rNums = random.sample(range(1,46),7)</p>
<p>print(f&#39;rNums: {rNums}&#39;)
write_numbers(rNums)</p>
<pre><code>### writelines()
writelines()는 리스트 또는 튜플 데이터를 파일에 쓰기 위한 함수이다.</code></pre><p>languages = [&#39;c++&#39;, &#39;java&#39;, &#39;c#&#39;, &#39;python&#39;]</p>
<p>url = &#39;C:/pythonTxt/&#39;
with open(url + &#39;languages.txt&#39;, &#39;a&#39;) as f:
f.writelines(languages)
#f.writelines(item + &#39;\n&#39; for item in languages) 아이템 하나씩 개행하려면 이렇게</p>
<pre><code>
_실습_</code></pre><p>딕셔너리에 저장된 과목별 점수를 파일에 저장하는 코드를 작성하자.
url = &#39;C:/pythonTxt/&#39;
#특정한 포멧으로 만들고 싶을 때
scoreDic = {&#39;kor&#39;: 85, &#39;eng&#39;: 95, &#39;math&#39;: 85, &#39;sci&#39;: 95, &#39;his&#39;: 35}</p>
<p>for key in scoreDic.keys():
    with open(url + &#39;score_dic.txt&#39;, &#39;a&#39;) as f:
    f.write(key + &#39;\t:&#39; + str(scoreDic[key]) + &#39;\n&#39;)</p>
<p>scoreDic = {&#39;kor&#39;: 85, &#39;eng&#39;: 95, &#39;math&#39;: 85, &#39;sci&#39;: 95, &#39;his&#39;: 35}
with open(url + &#39;scores.txt&#39;, &#39;a&#39;) as f:
print(scoreDic, file= f) #딕셔너리나 리스트 자체를 저장하고 싶을 때</p>
<pre><code>### readlines()
파일의 모든 데이터를 읽어서 리스트 형태로 변환한다.</code></pre><p>url = &#39;C:/pythonTxt/&#39;</p>
<p>with open(url + &#39;lans.txt&#39;, &#39;r&#39;) as f:
lanList = f.readlines()</p>
<pre><code>#### readline()
한 행을 읽어서 문자열로 반환한다.</code></pre><p>with open(url + &#39;lans.txt&#39;, &#39;r&#39;) as f:
line = f.readline()</p>
<p>while line != &#39;&#39;
print(f&#39;line: {line}&#39;, end = &#39;&#39;)
line = f.readline()</p>
<pre><code>_실습_</code></pre><p>파일에 저장된 과목별 점수를 파이썬에서 읽어, 딕셔너리에 저장하는 코드를 만들어보자.
scoreDic = {}
with open(url + &#39;scores.txt&#39;, &#39;r&#39;) as f:
line = f.readline()</p>
<p>while line != &#39;&#39;:
templist = line.split(&#39;:&#39;) #()것을 기준으로 (구분자) 해서 다 리스트로 분리해줌.
scoreDic[templist[0]] = int(templist[1].strip(&#39;\n&#39;)) #\n 문자 삭제
line = f.readline()</p>
<p>print(f&#39;scoredic: {scoreDic}&#39;)
```</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[제로베이스 데이터 분석 스쿨 2기] Python(feat. 함수, 인수와 매개변수, 전역 변수 & 지역 변수, global, 중첩 함수, lambda, 모듈)]]></title>
            <link>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-Pythonfeat.-%ED%95%A8%EC%88%98-%EC%9D%B8%EC%88%98%EC%99%80-%EB%A7%A4%EA%B0%9C%EB%B3%80%EC%88%98-%EC%A0%84%EC%97%AD-%EB%B3%80%EC%88%98-%EC%A7%80%EC%97%AD-%EB%B3%80%EC%88%98-global-%EC%A4%91%EC%B2%A9-%ED%95%A8%EC%88%98-lambda-%EB%AA%A8%EB%93%88</link>
            <guid>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-Pythonfeat.-%ED%95%A8%EC%88%98-%EC%9D%B8%EC%88%98%EC%99%80-%EB%A7%A4%EA%B0%9C%EB%B3%80%EC%88%98-%EC%A0%84%EC%97%AD-%EB%B3%80%EC%88%98-%EC%A7%80%EC%97%AD-%EB%B3%80%EC%88%98-global-%EC%A4%91%EC%B2%A9-%ED%95%A8%EC%88%98-lambda-%EB%AA%A8%EB%93%88</guid>
            <pubDate>Thu, 18 Jan 2024 12:12:15 GMT</pubDate>
            <description><![CDATA[<h3 id="함수">함수</h3>
<p>함수란, 특정 기능을 재사용하기 위해서 사용한다.</p>
<pre><code>def add_cal ():
    n1 = int(input(&#39;n1: &#39;))
    n2 = int(input(&#39;n2: &#39;))
print(f&#39;n1 + n2 = {n1+n2}&#39;)
add_cal()

def cal_fun():
    n1 = int(input(&#39;num1: &#39;))
    n2 = int(input(&#39;num2: &#39;))

print(f&#39;n1 * n2 = {n1 * n2}&#39;)
print(f&#39;n1 / n2 = {round(n1/n2)}&#39;)
cal_fun()</code></pre><h3 id="인수와-매개변수">인수와 매개변수</h3>
<pre><code>def greet(customer): ---&gt; 매개변수
    print(f&#39;{customer})

greet(&#39;홍길동&#39;) ---&gt; 인수

#매개변수 개수가 정해지지 않은 경우 &#39;*&#39;를 이용한다.
def print_number(*numbers):
    for number in numbers:
        print(number, end= &#39;&#39;)
    print()

print_number()
print_number(1,2,3)
print_number(1,2,3,4,5,6)</code></pre><p><em>실습</em></p>
<pre><code>국어, 영어, 수학 점수를 입력받고, 입력받은 점수를 이용해서 총점과 평균을 출력하는 함수를 만들어 보자.

def print_score(kor, eng, math):
    sum = kor +eng + math
    avg = sum / 3

    print(f&#39;총점: {sum}&#39;)
    print(f&#39;평균: {avg}&#39;)
kor_score = int(input(&#39;korean score: &#39;))
eng_score = int(input(&#39;english score: &#39;))
math_score = int(input(&#39;math score: &#39;))

print_score(kor_score, eng_score, math_score)
</code></pre><h3 id="전역-변수--지역-변수">전역 변수 &amp; 지역 변수</h3>
<p>젼역 변수란, 함수 밖에서 정의한 변수. 함수 내부에서 수정할 수 없다.
지역 변수란, 함수 내에서 정의된 변수. 함수가 호출되는 그 순간에만 존재한다. </p>
<pre><code>num_out = 10 #전역변수
def print_numbers():
    num_out = 20 #지역변수
    print(f&#39;num_out: {num_out}&#39;)

print_numbers() #값은 20 지역변수 영향
print(f&#39;num_out: {num_out}&#39;) #값은 10 전역변수 영향</code></pre><p><em>실습</em></p>
<pre><code>사용자가 가로, 세로 길이를 입력하면 삼각형과 사각형의 넓이를 출력하는 함수를 만들어보자.

width = int(input(&#39;가로 길이: &#39;))
height = int(input(&#39;세로 길이: &#39;))

def print_area():
    triangle = width * height/2
    square = width * height
    print(f&#39;삼각형의 넓이는: {triangle}&#39;)
    print(f&#39;사각형의 넓이는: {square}&#39;)
print_area()</code></pre><h3 id="global-키워드">global 키워드</h3>
<p>global을 사용하면 함수 안에서도 전역 변수의 값을 수정할 수 있다. </p>
<pre><code>num_out = 10
def print_numbers():
global num_out #전역변수 값 수정 가능
num_out = 20
print(f&#39;num_out: {num_out}&#39;)

print_numbers() #값은 20 지역변수 영향
print(f&#39;num_out: {num_out}&#39;) #값은 20 global 영향</code></pre><p><em>실습</em></p>
<pre><code>방문객 수를 카운트하는 함수를 만들어보자.
total_visit = 0

def total_visit_count():
    global total_visit

    total_visit = total_visit + 1
    print(f&#39;누적 방문객 = {total_visit}&#39;)

total_visit_count()#누적 방문객 = 1
total_visit_count()#누적 방문객 = 2
total_visit_count()#누적 방문객 = 3
total_visit_count()#누적 방문객 = 4</code></pre><h3 id="중첩-함수">중첩 함수</h3>
<p>중첩 함수란, 함수안에 또 다른 함수가 있는 형태이다.
내부 함수를 함수 밖에서 호출할 수 없다.</p>
<pre><code>def out_func():
    print(&#39;outfunc called&#39;)

def in_func():
    print(&#39;infunc called&#39;)
    in_func()

out_func()
in_func() --&gt; error</code></pre><p><em>실습</em></p>
<pre><code>calculator()함수를 선언하고 이 함수안에 덧셈, 뺄셈, 곱셈, 나눗셈 함수를 선언하자.

def calculator(n1, n2, operator):

    def add_cal():
    print(f&#39;덧셈 = {n1 + n2}&#39;)

    def sub_cal():
    print(f&#39;뺄셈 = {n1 - n2}&#39;)

    def mul_cal():
    print(f&#39;곱셈 = {n1 * n2}&#39;)

    def div_cal():
    print(f&#39;나눗셈 = {n1 / n2}&#39;)

    if operator == 1:
        add_cal()
    elif operator == 2:
        sub_cal()
    elif operator == 3:
        mul_cal()
    elif operator == 4:
        div_cal()

while True:
    num1 = float(input(&#39;첫 번째 숫자 입력: &#39;))
    num2 = float(input(&#39;두 번째 숫자 입력: &#39;))
    operator = int(input(&#39;1. 덧셈, 2. 뺄셈, 3. 곱셈, 4. 나눗셈, 5. 종료&#39;))

    if operator == 5:
        print(&#39;Thank you&#39;)
        break
calculator(num1, num2, operator)</code></pre><h3 id="lambda">lambda</h3>
<p>lambda 키워드를 이용하면 함수 선언을 보다 간단하게 할 수 있다. </p>
<pre><code>def calculator(n1,n2):
    return n1 + n2
    return_value = calculator(10,20)
    print(f&#39;result = {return_value}&#39;)

#lambda를 사용하면

calculator = lambda n1,n2: n1 + n2
return_value = calculator(10,20)
print(f&#39;result = {return_value}&#39;)</code></pre><p><em>실습</em></p>
<pre><code>삼각형, 사각형, 원의 넓이를 반환하는 lambda 함수를 만들어보자.

get_triangle_area = lambda n1,n2: n1 * n2 / 2
get_square_area = lambda n1,n2: n1 * n2
get_circle_area = lambda r: r * r * 3.14

weight = int(input(&#39;가로 길이: &#39;))
height = int(input(&#39;세로 길이: &#39;))
radius = int(input(&#39;반지름 길이: &#39;))

triangle = get_triangle_area(weight, height)
square = get_square_area(weight, height)
circle = get_circle_area(radius)

print(f&#39;triangle area = {triangle}&#39;)
print(f&#39;square area = {square}&#39;)
print(f&#39;circle area = {circle}&#39;)</code></pre><h3 id="모듈">모듈</h3>
<p>모듈이란, 이미 만들어진 훌륭한 기능으로 사용자들이 쉽게 사용할 수 있다.</p>
<p><em>실습</em></p>
<pre><code>1. random 모듈을 이용해서 1부터 10까지의 정수 중 난수 1개를 발생시켜 보자.
2. random 모듈을 이용해서 0부터 100사이의 난수 10개를 발생시켜 보자.

import random

r_number = random.randint(1,10) #random.randint(범위)
print(f&#39;random number = {r_number}&#39;)

r_numbers = random.sample(range(1,101),10) #random.sample(범위, 갯수)
print(f&#39;random numbers = {r_numbers}&#39;)
</code></pre><h4 id="모듈-만들기">모듈 만들기</h4>
<ol>
<li>파이썬 파일을 만든다. (예시, calculator)<pre><code>def add(n1, n2):
 print(f&#39;덧셈의 결과 = {n1 + n2}&#39;)
</code></pre></li>
</ol>
<p>def sub(n1, n2):
    print(f&#39;뺄셈의 결과 = {n1 - n2}&#39;)</p>
<p>def mul(n1, n2):
    print(f&#39;곱셈의 결과 = {n1 * n2}&#39;)</p>
<p>def div(n1, n2):
    print(f&#39;나눗셈의 결과 = {n1 / n2}&#39;)</p>
<pre><code>2. 만든 파일의 이름을 import한 후 사용한다.</code></pre><p>import calculator</p>
<p>calculator.add(10,20)
calculator.sub(10,20)
calculator.mul(10,20)
calculator.div(10,20)</p>
<pre><code>#### 모듈 사용(import, from, as)
import 키워드를 이용해서 모듈을 임포트 한다.</code></pre><p>import키워드를 이용해서 모듈을 임포트 한다.
import calculator</p>
<p>calculator.add(10,20)
calculator.sub(10,20)
calculator.mul(10,20)
calculator.div(10,20)</p>
<pre><code>as 키워드를 이용해서 모듈 이름을 단축 시킬 수 있다.</code></pre><p>import calculator as cal</p>
<p>calculator.add(10,20)
calculator.sub(10,20)
calculator.mul(10,20)
calculator.div(10,20)</p>
<pre><code>from~as 키워드를 이용해서 모듈의 특정 기능만 사용할 수 있다. </code></pre><p>from calculator import add
add(10,20)</p>
<p>from calculator import add, sub
add(10,20)
sub(10,20)</p>
<p>from calculator import * -&gt; 칼큘레이터에 있는 모든것을 가져오겠다.</p>
<pre><code>### 실행(메인) 파일
실행 파일: 내가 모듈을 실행하는 파일

____name____ 전역 변수: 모듈 이름이 저장되거나, 실행 파일일 경우 &#39;____main____&#39;이 저장된다.

_실습_</code></pre><p>실습
#1번 모듈 파일 (unitconversion)
def cm_to_mm(n):
    return round(n * 10,3)</p>
<p>def cm_to_inch(n):
    return round(n *0.393, 3)</p>
<p>def cm_to_m(n):
    return round(n * 0.01, 3)</p>
<p>def cm_to_ft(n):
    return round(n * 0.032, 3)</p>
<p>if <strong>name</strong> == &#39;<strong>main</strong>&#39;:
  print(f&#39;10cm: {cm_to_mm(10)}mm&#39;)
  print(f&#39;10cm: {cm_to_inch(10)}inch&#39;)
  print(f&#39;10cm: {cm_to_ft(10)}ft&#39;)
  print(f&#39;10cm: {cm_to_m(10)}m&#39;)</p>
<p>2번 실행 파일
import unitconversion as uc</p>
<p>if <strong>name</strong> == &#39;<strong>main</strong>&#39;:
    user_number = int(input(&#39;길이(cm) 입력: &#39;))</p>
<p>result_mm = uc.cm_to_mm(user_number)
result_inch = uc.cm_to_inch(user_number)
result_m = uc.cm_to_m(user_number)
result_ft = uc.cm_to_ft(user_number)</p>
<p>print(f&#39;해당 길이의 mm 변환은 {result_mm}mm입니다.&#39;)
print(f&#39;해당 길이의 inch 변환은 {result_inch}inch입니다.&#39;)
print(f&#39;해당 길이의 m 변환은 {result_m}m입니다.&#39;)
print(f&#39;해당 길이의 ft 변환은 {result_ft}ft입니다.&#39;)</p>
<pre><code>#### 자주 사용하는 모듈 모음

math 모듈: 수학 관련 모듈</code></pre><p>#합
list = [2, 4, 5, 3, 29]
print(sum(list))</p>
<p>#최댓값
print(max(list))</p>
<p>#최솟값
print(min(list))</p>
<p>#거듭제곱
print(pow(12,2)) #12의 2제곱</p>
<p>#반올림
print(round(3.13432,2))</p>
<p>import math</p>
<p>#절댓값
print(math.abs(-10))</p>
<p>#올림
print(math.ceil(5.81))</p>
<p>#내림
print(math.floor(5.22))</p>
<p>#버림
print(math.trunc(5.32))</p>
<p>#최대공약수
print(math.gcd(14,21))</p>
<p>#팩토리얼
print(math.factorial(10))</p>
<p>#제곱근
print(math.sqrt(4))</p>
<pre><code>
random 모듈: 난수 관련 모듈</code></pre><p>#1~10까지 난수 1개
random.randint(1,10)</p>
<p>#1~50까지 난수 5개
random.sample(range(1,50),5)</p>
<pre><code>time 모듈: 시간 관련 모듈</code></pre><p>#년도
print(f&#39;localtime year: {local_time.tm_year}&#39;)
#월
print(f&#39;localtime month: {local_time.tm_mon}&#39;)
#일자
print(f&#39;localtime day: {local_time.tm_mday}&#39;)
#시
print(f&#39;localtime hour: {local_time.tm_hour}&#39;)
#분
print(f&#39;localtime min: {local_time.tm_min}&#39;)
#초
print(f&#39;localtime second: {local_time.tm_sec}&#39;)
#요일 (0부터 월요일)
print(f&#39;localtime week of day: {local_time.tm_wday}&#39;)
```</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[제로베이스 데이터 분석 스쿨 2기] Python(feat. 조건문(if), 양자택일 (if~else), 다자택일 (if~elif), 반복문 (횟수, 조건), 반복문 제어(continue, else, break, 중첩 반복문)]]></title>
            <link>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-DAY3-feat.-%EC%A1%B0%EA%B1%B4%EB%AC%B8if-%EC%96%91%EC%9E%90%ED%83%9D%EC%9D%BC-ifelse-%EB%8B%A4%EC%9E%90%ED%83%9D%EC%9D%BC-ifelif-%EB%B0%98%EB%B3%B5%EB%AC%B8-%ED%9A%9F%EC%88%98-%EC%A1%B0%EA%B1%B4-%EB%B0%98%EB%B3%B5%EB%AC%B8-%EC%A0%9C%EC%96%B4continue-else-break-%EC%A4%91%EC%B2%A9-%EB%B0%98%EB%B3%B5%EB%AC%B8</link>
            <guid>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-DAY3-feat.-%EC%A1%B0%EA%B1%B4%EB%AC%B8if-%EC%96%91%EC%9E%90%ED%83%9D%EC%9D%BC-ifelse-%EB%8B%A4%EC%9E%90%ED%83%9D%EC%9D%BC-ifelif-%EB%B0%98%EB%B3%B5%EB%AC%B8-%ED%9A%9F%EC%88%98-%EC%A1%B0%EA%B1%B4-%EB%B0%98%EB%B3%B5%EB%AC%B8-%EC%A0%9C%EC%96%B4continue-else-break-%EC%A4%91%EC%B2%A9-%EB%B0%98%EB%B3%B5%EB%AC%B8</guid>
            <pubDate>Mon, 08 Jan 2024 05:25:23 GMT</pubDate>
            <description><![CDATA[<h3 id="조건식">조건식</h3>
<p>참일 경우 앞이 출력, 불인 경우 뒤가 출력</p>
<pre><code>num1 = 10
num2 = 100

numResult = True if num1&gt; num2 else False
print(&#39;num1 &gt; num2: {}&#39;.format(numResult))
OR
print(&#39;num1 &gt; num2 크다&#39;) if numResult else print(&#39;num2&gt; num1&#39;)</code></pre><p><em>실습</em></p>
<pre><code>**국어, 영어, 수학 점수를 입력하면 조건식을 이용해서 과목별 결과와 전체 결과를 출력하는 코드를 작성해보자. (과목별 합격 점수: 60점, 전페 합격 평균 점수: 70점)**

import operator
passScore = 60
passAvgScore = 70

kor = int(input(&#39;국어 점수: &#39;))
eng = int(input(&#39;영어 점수: &#39;))
math = int(input(&#39;수학 점수: &#39;))
totalScore = kor + eng + math
avg = totalScore/3

print(&#39;국어: PASS&#39;)if operator.gt(kor, passScore) else print(&#39;국어: FAIL&#39;)
print(&#39;영어: PASS&#39;)if operator.gt(eng, passScore) else print(&#39;영어: FAIL&#39;)
print(&#39;수학: PASS&#39;)if operator.gt(math, passScore) else print(&#39;수학: FAIL&#39;)
print(&#39;시험: PASS&#39;)if operator.gt(avg, passAvgScore) else print(&#39;시험: FAIL&#39;)
print(&#39;총점: %d, 평균: %.2f&#39; % (totalScore, avg))

</code></pre><h4 id="조건문-if문">조건문 (if문)</h4>
<p>if문 -&gt; 단일조건
<em>실습</em></p>
<pre><code>**실내 온도를 입력하고 온도가 28도 이상이면 &#39;냉방 작동&#39;, 20도 이하면 &#39;난방 작동&#39;이 출력되는 코드를 작성하자**

highTem = 28
lowTem = 20
insideTem = int(input(&#39;실내 온도 입력: &#39;))

if insideTem &lt;= lowTem:
    print(&#39;난방 작동&#39;)

if insideTem &gt;= highTem:
    print(&#39;냉방 작동&#39;)
</code></pre><h4 id="양자택일-조건문-ifelse문">양자택일 조건문 (if~else문)</h4>
<pre><code>if my_score &gt;= pass_score:
    print(&#39;PASS&#39;)
else:
    print(&#39;FAIL&#39;)</code></pre><p><em>실습</em></p>
<pre><code>**소수점 첫 번째 자리에서 반올림하는 프로그램을 만들어 보자.**

floatNum = float(input(&#39;소수 입력: &#39;))

if floatNum - int(floatNum) &gt;= 0.5:
    print(&#39;{}: {}&#39;.format(&#39;올림&#39;,floatNum+1))
else:
    print(&#39;{}: {}&#39;.format(&#39;버림&#39;, int(floatNum)))</code></pre><h4 id="다자택일-조건문-ifelif">다자택일 조건문 (if~elif)</h4>
<p>주의할 점:
조건식 순서가 중요하다.
조건 범위를 명시한다.</p>
<pre><code>example_score = int(input(&#39;시험 성적 입력: &#39;))
grades = &#39; &#39;

if example_score &gt;= 90:
grades = &#39;A&#39;
elif example_score &gt;= 80:
grades = &#39;B&#39;
elif example_score &gt;= 70:
grades = &#39;C&#39;
elif example_score &gt;= 60:
grades = &#39;D&#39;
else:
grades = &#39;F&#39;
print(&#39;성적: {} \t 학점: {}&#39;.format(example_score, grades))</code></pre><h3 id="반복문">반복문</h3>
<p>반복문 이란?
특정 실행을 반복한느 것. 반복문을 사용하면 프로그래밍이 간결하고 유지 보수가 쉽다.</p>
<pre><code>for i in range(1,20):
print(&#39;{} * {} = {}&#39;.format(5,i,(5*i))</code></pre><h4 id="횟수에-의한-반복">횟수에 의한 반복</h4>
<pre><code>for i in range(10):
result = 7 * i
print(&#39;{} * {} = {}&#39;.format(7,i,result))</code></pre><p>range() 기본 사용 방법
range(시작, 끝, 단계)
ex) range(1,11,1) -&gt; 1부터 10까지 1씩 증가
단계 매개변수 생략 -&gt; 단계가 1인 경우 생략 가능, 시작이 0인 경우 생략 가능</p>
<h4 id="조건에-의한-반복">조건에 의한 반복</h4>
<pre><code>n = 1
while n&lt; 10:
result = 7 * n
print(&#39;{} * {} = {}&#39;.format(7,n, (7*n)))
n += 1</code></pre><p><em>실습</em></p>
<pre><code>multi = int(input(&#39;희망 구구단 입력: &#39;))

n = 1
while n &lt; 10:
result = multi * n
print(&#39;{} * {} = {}&#39;.format(multi, n, result))
n += 1</code></pre><p><em>무한 반복 실형 논리형 데이터 사용 실습</em></p>
<pre><code>**하루에 독감으로 병원에 내방하는 환자 수가 50명에서 100명 사이일 때, 누적 독감 환자 수가 최초 10,000명을 넘는 날짜를 구해보자.**
import random
flag = True
sum = 0
date = 0
while flag:
dayPatient = random.randint(50,100)
sum += dayPatient
date += 1
print(&#39;날짜: {}, \t 오늘 환자 수: {}, \t 누적 환자수: {}&#39;.format(date, dayPatient, sum))

if sum &gt;= 10000:
flag = False</code></pre><h3 id="반복문-제어">반복문 제어</h3>
<h4 id="continue-키워드">Continue 키워드</h4>
<p>반복 실행 중 continue를 만나면 실행을 생략하고, 다음 반복 실행문으로 넘어간다.</p>
<pre><code>for i in range(100):
if i % 7 != 0:
continue
print(&#39;{}는 7의 배수 입니다.&#39;.format(i))</code></pre><h4 id="else-키워드">else 키워드</h4>
<p>반복문이 종료된 후 실행된다.</p>
<pre><code>cnt = 0
for i in range(1,100):
if i % 7 != 0:
continue

print(&#39;{}는 7의 배수 입니다.&#39;.format(i))
cnt += 1
else:
print(&#39;99까지의 정수 중 7이 배수는 {}입니다.&#39;.format(cnt))</code></pre><h4 id="break-키워드">break 키워드</h4>
<p>반복 실행 중 break를 만나면 반복문을 빠져나온다.</p>
<pre><code>sum = 0
searchNum = 0

for i in range(100):
sum += i

if sum &gt; 100:
searchNum = i
break
print(&#39;searchNum = {}&#39;.format(searchNum ))</code></pre><p><em>실습</em></p>
<pre><code>**새끼 강아지 체중이 2.2KG이 넘으면 이유식을 중단하려고 한다. 한번 이유식을 먹을 때 체주이 70g 증가한다고 할 때, 예상되는 이유식 날짜를 구하자. (현재 체중은 800g)**
limitedWeight = 2200
curentWeight = 800
date = 1

while True:
date += 1
curentWeight += 70

if curentWeight &gt;= limitedWeight:
break
print(&#39;이유식 중단 날짜: {}&#39;.format(date))
</code></pre><h3 id="중첩-반복문">중첩 반복문</h3>
<p>반복문안에 또 다른 반복문을 선언한다.</p>
<pre><code>for i in range(1,10):
for j in range(i):
print(&#39;*&#39;, end=&#39;&#39;)
print()</code></pre><p><em>실습</em></p>
<pre><code>**구구단 전체 출력**
for i in range(1,10):
for j in range(2,10):
result = j * i
print(&#39;{} * {} = {}\t&#39;.format(j,i,result),end= &#39;&#39;)
print()
</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[[제로베이스 데이터 분석 스쿨 2기] Python (feat. 데이터 입력 및 출력, 산술 연산자, 복합 연산자, 비교 연산자, 논리 연산자, Operator 모듈)]]></title>
            <link>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-DAY2-feat.-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EC%9E%85%EB%A0%A5-%EB%B0%8F-%EC%B6%9C%EB%A0%A5-%EC%82%B0%EC%88%A0-%EC%97%B0%EC%82%B0%EC%9E%90-%EB%B3%B5%ED%95%A9-%EC%97%B0%EC%82%B0%EC%9E%90-%EB%B9%84%EA%B5%90-%EC%97%B0%EC%82%B0%EC%9E%90-%EB%85%BC%EB%A6%AC-%EC%97%B0%EC%82%B0%EC%9E%90-Operator-%EB%AA%A8%EB%93%88</link>
            <guid>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-DAY2-feat.-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EC%9E%85%EB%A0%A5-%EB%B0%8F-%EC%B6%9C%EB%A0%A5-%EC%82%B0%EC%88%A0-%EC%97%B0%EC%82%B0%EC%9E%90-%EB%B3%B5%ED%95%A9-%EC%97%B0%EC%82%B0%EC%9E%90-%EB%B9%84%EA%B5%90-%EC%97%B0%EC%82%B0%EC%9E%90-%EB%85%BC%EB%A6%AC-%EC%97%B0%EC%82%B0%EC%9E%90-Operator-%EB%AA%A8%EB%93%88</guid>
            <pubDate>Sun, 07 Jan 2024 15:16:55 GMT</pubDate>
            <description><![CDATA[<h3 id="데이터-입력">데이터 입력</h3>
<h4 id="input-데이터-입력을-위한-함수">input(): 데이터 입력을 위한 함수</h4>
<p>input() 함수를 이용해서 입력한 데이터는 항상 문자(열) 자료형. 따라서, 형 변환 함수를 이용하여 형 변환을 해야함.
ex) userInputData = int(input(&#39;정수형을 입력하세요.&#39;))</p>
<pre><code>_실습_
**사용자가 가로, 세로 길이를 입력하면 삼각형과 사각형의 넓이가 출력되는 코드를 작성해보자.**
width = float(input(&#39;가로길이: &#39;))
height = float(input(&#39;높이: &#39;))

triangle = width * height /2
square = width * height

print(&#39;삼각형의 넓이는 =&#39;, triangle)
print(&#39;사각형의 넓이는 =&#39;, square)
</code></pre><h3 id="데이터-출력">데이터 출력</h3>
<h4 id="format-함수를-이용한-데이터-출력">format() 함수를 이용한 데이터 출력</h4>
<pre><code>userName = &quot;hong&quot;
userAge = 21

print(&#39;User Name: {}&#39;.format(userName))
print(&#39;User Age: {}&#39;.format(userAge))

print(&#39;Use Name: {}, User Age: {}&#39;.format(userName, userAge))
print(&#39;Use Name: {1}, User Age: {0}&#39;.format(userName, userAge)) #순서를 바꾸고 싶을 땐

print(&#39;나의 이름은 {0}이고, 나이는 {1}살 입니다. {0}이름은 아버지께서 지어주셨습니다.&#39;. format(userName,userAge))</code></pre><h4 id="형식-문자를-이용한-데이터-출력">형식 문자를 이용한 데이터 출력</h4>
<pre><code>%s -&gt; 문자열
%d -&gt; 정수
%f -&gt; 실수
userName = &quot;hong&quot;
userAge = 21

print(&#39;User Name: %s&#39; % userName)
print(&#39;User Age: %d&#39; % userAge)
print(&#39;User Name: %s, User Age: %d&#39; % (userName,userAge))</code></pre><h4 id="소수점-자릿수-정하기">소수점 자릿수 정하기</h4>
<pre><code>%.nf -&gt; 소수점 n자리 표현
pi = 3.14
print(&#39;Pie: %f&#39; % pi)
print(&#39;Pie: %1f&#39; % pi) #소수 첫 째자리</code></pre><p><em>실습</em></p>
<pre><code>반지름 입력: 3
원주율 입력: 3.14192
radius: 3.0
pi: 3.14192
radius: 3.000000, pi: 3.141920
radius: 3.00, pi: 3.14

radius= float(input(&#39;반지름 입력: &#39;))
pi = float(input(&#39;원주율 입력: &#39;))

print(&#39;radius: {}\npi: {}&#39;.format(radius, pi))
print(&#39;radius: %.6f, pi: %.6f&#39; % (radius, pi))
print(&#39;radius: %.2f, pi: %.2f&#39; % (radius, pi))</code></pre><h3 id="산술-연산자-덧셈-뺄셈">산술 연산자 (덧셈, 뺄셈)</h3>
<p><em>실습</em></p>
<pre><code>국어 점수: 85
영어 점수: 90
영어 점수: 95
국어 점수 85
영어 점수 90
수학 점수 95
합계 점수 270

kor = int(input(&#39;국어 점수: &#39;))
eng = int(input(&#39;영어 점수: &#39;))
math = int(input(&#39;영어 점수: &#39;))

total = kor + eng + math

print(&#39;국어 점수 {}&#39;.format(kor))
print(&#39;영어 점수 {}&#39;.format(eng))
print(&#39;수학 점수 {}&#39;.format(math))
print(&#39;합계 점수 {}&#39;.format(total))
</code></pre><p><em>실습2</em> </p>
<pre><code>알바비: 800000
카드 값: 453700
partTimeMoney: 800000원
cardMoney: 453700원
남는 돈: 346300원

partTimeMoney = int(input(&#39;알바비: &#39;))
cardMoney = int(input(&#39;카드 값: &#39;))
result = partTimeMoney - cardMoney

print(&#39;partTimeMoney: {}원&#39;.format(partTimeMoney))
print(&#39;cardMoney: {}원&#39;.format(cardMoney))
print(&#39;남는 돈: {}원&#39;.format(result))
</code></pre><h3 id="산술-연산자-곱셈-나눗셈">산술 연산자 (곱셈, 나눗셈)</h3>
<p><em>실습</em></p>
<pre><code>국어 점수: 85
영어 점수: 90
수학 점수: 90
국어 점수: 85
영어 점수: 90
수학 점수: 90
합계: 265
평균: 88.33333333333333
평균 88.33

kor = int(input(&#39;국어 점수: &#39;))
eng = int(input(&#39;영어 점수: &#39;))
math = int(input(&#39;수학 점수: &#39;))
total = kor + eng + math
avg = total/3

print(&#39;국어 점수: {}&#39;.format(kor))
print(&#39;영어 점수: {}&#39;.format(eng))
print(&#39;수학 점수: {}&#39;.format(math))
print(&#39;합계: {}&#39;.format(total))
print(&#39;평균: {}&#39;.format(avg))
print(&#39;평균 %.2f&#39; % (avg))</code></pre><h3 id="산술-연산자-나머지와-몫">산술 연산자 (나머지와 몫)</h3>
<h4 id="나머지-구하기-">나머지 구하기: /</h4>
<p>num1 = 10
num2 = 3
result = num1/ num2
print(&#39;num1: {}, num2: {}, result: {}&#39;. format(num1, num2, result))</p>
<h4 id="몫-구하기-">몫 구하기: %</h4>
<p>result = num1 % num2
print(&#39;num1: {}, num2: {}, result: {}&#39;.format(num1, num2, result1))</p>
<h4 id="나머지와-몫-한-번에-구하기-divmod">나머지와 몫 한 번에 구하기: divmod()</h4>
<p>result = divmod(num1, num2)
print(&#39;result: {}&#39;.format(result))
print(&#39;몫: {}&#39;.format(result[0]))
print(&#39;나머지: {}&#39;.format(result[1]))</p>
<p><em>실습</em></p>
<pre><code>전체 학생 수: 25
한 모둠 학생 수: 4
전체 학생 수: 25
한 모둠의 학생 수: 4
모둠 수: 6
남는 학생 수: 1

totalStu = int(input(&quot;전체 학생 수: &quot;))
stu_of_group = int(input(&#39;한 모둠 학생 수: &#39;))
result = divmod(totalStu, stu_of_group)

print(&quot;전체 학생 수: {}&quot;. format(totalStu))
print(&quot;한 모둠의 학생 수: {}&quot;. format(stu_of_group))
print(&quot;모둠 수: {}&quot;. format(result[0]))
print(&quot;남는 학생 수: {}&quot;. format(result[1]))
</code></pre><p><em>실습2</em></p>
<pre><code>Q. 123개의 사과를 4개씩 직원들에게 나누어 주려고 한다. 최대 나누어 줄 수 있는 직원수와 남는 사과 개수를 출력해보자.

A. 직원당 사과 수: 30, 남는 사과: 3
employee = 123
apple = 4
result = divmod(employee,apple)

print(&#39;직원당 사과 수: {}&#39;. format(result[0])) #30
print(&#39;남는 사과 수: {}&#39;. format(result[1])) #3</code></pre><h3 id="산술-연산자-거듭제곱">산술 연산자 (거듭제곱)</h3>
<h4 id="거듭제곱-구하기-">거듭제곱 구하기: **</h4>
<p>num1 = 2
num2 = 3
result = num1 ** num2
print(&quot;result:{}&quot;.format(result))</p>
<h4 id="제곱근-구하기-n--1m">제곱근 구하기: n ** (1/m)</h4>
<p>#2의 제곱근 구하기
result = 2 ** (1/2)
print(&#39;result: {}&#39;.format(result))
print(&#39;2의 제곱근 %.2f&#39; % result)</p>
<p>#2의 3제곱근
result2 = 2 ** (1/3)
print(&#39;result: {}&#39;.format(result2))
print(&#39;3의 제곱근 %.2f&#39; % result2)</p>
<p>#2의 4제곱근
result3 = 2 ** (1/4)
print(&#39;result: {}&#39;.format(result3))
print(&#39;4제곱근: %.2f&#39; % result3)</p>
<h4 id="sqrt함수를-이용한-제곱근-구하기-단-sqrt-함수는-오직-제곱근만-구해줌">sqrt()함수를 이용한 제곱근 구하기 <em>(단, sqrt() 함수는 오직 제곱근만 구해줌)</em></h4>
<p>import math
#2의 제곱근
print(&#39;2의 제곱근 %f&#39; % math.sqrt(2))
print(&#39;2의 제곱근 %.2f&#39; % math.sqrt(2))</p>
<p>#3의 제곱근
print(&#39;3의 제곱근 %f&#39; % math.sqrt(3))
print(&#39;3의 제곱근 %.2f&#39; % math.sqrt(3))</p>
<p>#4의 제곱근
print(&#39;4의 제곱근 %.2f&#39; % math.sqrt(4))</p>
<h4 id="pow-함수를-이용한-거듭제곱-구하기">pow() 함수를 이용한 거듭제곱 구하기</h4>
<p>import math
#2^3
print(&#39;2의 3제곱 %.2f&#39; % math.pow(2,3))</p>
<p>#3^4
print(&#39;3의 4제곱 %.2f&#39; % math.pow(3,4))</p>
<p>실습
아들이 엄마한테 용돈을 받는데, 첫 달에는 200원을 받고 매월 이전 달의 2배씩 인상하기로 했다. 12개월째 되는 달에는 얼마를 받을 수 있는지 계산해 보자.</p>
<p>firstMon = 200
after12 = ((firstMon<em>0.01) *</em> 12) * 100
print(&#39;12개월 후 총액: {}&#39;. format(after12))</p>
<p>*****3자리수 마다 ,찍기
after12 = int(after12)
after12 = format(after12, &#39;,&#39;)
print(after12, &#39;원&#39;)</p>
<h3 id="복합-연산자">복합 연산자</h3>
<h4 id="----덧셈-연산-후-할당">+= --&gt; 덧셈 연산 후 할당</h4>
<p>num += 3 #num= num + 3
print(&#39;num: {}&#39;. format(num))</p>
<h4 id="-----뺄셈-연산-후-할당">-= --&gt; 뺄셈 연산 후 할당</h4>
<p>num -= 3 #num= num - 3
print(&#39;num: {}&#39;. format(num))</p>
<h4 id="----곱셈-연산-후-할당">*= --&gt; 곱셈 연산 후 할당</h4>
<p>num *= 3 #num= num * 3
print(&#39;num: {}&#39;. format(num))</p>
<h4 id="----나눗셉-연산-후-할당">/= --&gt; 나눗셉 연산 후 할당</h4>
<p>num /= 3 #num= num / 3
print(&#39;num: {}&#39;. format(num))</p>
<h4 id="----나머지-연산-후-할당">%= --&gt; 나머지 연산 후 할당</h4>
<p>num %= 3 #num= num % 3
print(&#39;num: {}&#39;. format(num))</p>
<h4 id="----몫-연산-후-할당">//= --&gt; 몫 연산 후 할당</h4>
<p>num //= 3 #num= num // 3
print(&#39;num: {}&#39;. format(num))</p>
<h4 id="----거듭제곱-연산-후-할당">**= --&gt; 거듭제곱 연산 후 할당</h4>
<p>num <strong>*<em>= 3 #num= num *</em></strong> 3
print(&#39;num: {}&#39;. format(num))</p>
<p><em>실습</em>(누적 강수량 찾기)</p>
<pre><code>rainamount = 0
totalRain = 0

totalRain += 30
print(&#39;1월 누적 강수량: {}&#39;.format(totalRain))

totalRain += 45
print(&#39;2월 누적 강수량: {}&#39;.format(totalRain))

totalRain += 47
print(&#39;3월 누적 강수량: {}&#39;.format(totalRain))

totalRain += 55
print(&#39;4월 누적 강수량: {}&#39;.format(totalRain))

totalRain += 65
print(&#39;5월 누적 강수량: {}&#39;.format(totalRain))

totalRain += 100
print(&#39;6월 누적 강수량: {}&#39;.format(totalRain))

totalRain += 128
print(&#39;7월 누적 강수량: {}&#39;.format(totalRain))

totalRain += 209
print(&#39;8월 누적 강수량: {}&#39;.format(totalRain))

totalRain += 204
print(&#39;9월 누적 강수량: {}&#39;.format(totalRain))

totalRain += 186
print(&#39;10월 누적 강수량: {}&#39;.format(format(totalRain, &#39;,&#39;)))

totalRain += 67
print(&#39;11월 누적 강수량: {}&#39;.format(format(totalRain, &#39;,&#39;)))

totalRain += 25
print(&#39;12월 누적 강수량: {}&#39;.format(format(totalRain, &#39;,&#39;)))

rain_avg = totalRain/12
print(&#39;-&#39;*30)
print(&#39;연간 누적 강수량: {}mm&#39;.format(format(totalRain, &#39;,&#39;)))
print(&#39;연간 평균 강수량: {}mm&#39;.format(format(totalRain, &#39;,&#39;)))
print(&#39;-&#39;*30)</code></pre><h3 id="비교-연산자-숫자-비교">비교 연산자 (숫자 비교)</h3>
<h4 id="같다--같지-않다-">같다: ==/ 같지 않다: !=</h4>
<p><em>실습</em></p>
<pre><code>**자동차의 전장과 전폭을 입력하면 자동차 기계 세차 가능여부를 출력하는 코드를 작성해보자.
(최대 전장 길이: 5200mm, 최전폭: 1985)**
max_length = 5200
max_width = 1985

my_car_length = int(input(&#39;전장 길이 입력: &#39;))
my_car_width = int(input(&#39;전폭 길이 입력: &#39;))

print(&#39;전장 가능 여부: {}&#39;. format(max_length &gt;= my_car_length))
print(&#39;전폭 가능 여부: {}&#39;. format(max_width &gt;= my_car_width))</code></pre><h3 id="비교-연산자-문자-비교">비교 연산자 (문자 비교)</h3>
<p><em>실습</em></p>
<pre><code>cha1 = &#39;A&#39; #65
cha2 = &#39;S&#39; #83

print(&#39;\&#39;{} &gt; \&#39;{}\&#39; : {}&#39;.format(cha1,cha2, (cha1 &gt; cha2))) #\를 사용하면 다음 기호 무시
print(&#39;\&#39;{} &lt; \&#39;{}\&#39; : {}&#39;.format(cha1,cha2, (cha1 &lt; cha2)))
print(&#39;\&#39;{} &gt;= \&#39;{}\&#39; : {}&#39;.format(cha1,cha2, (cha1 &gt;= cha2)))
print(&#39;\&#39;{} &lt;= \&#39;{}\&#39; : {}&#39;.format(cha1,cha2, (cha1 &lt;= cha2)))
print(&#39;\&#39;{} == \&#39;{}\&#39; : {}&#39;.format(cha1,cha2, (cha1 == cha2)))
print(&#39;\&#39;{} != \&#39;{}\&#39; : {}&#39;.format(cha1,cha2, (cha1 != cha2)))</code></pre><h3 id="논리-연산자">논리 연산자</h3>
<h4 id="논리-연산자-종류-and-or-not">논리 연산자 종류: and, or, not</h4>
<p><em>실습</em></p>
<pre><code>**&#39;백신 접종 대상자는 20세 미만 또는 65세 이상자에 한합니다.&#39;를 논리연산자를 이용해서 코딩.
age = int(input(&quot;나이를 입력하세요: &quot;))
vaccine = (age&lt;20) or (age&gt;=65)
print(&#39;age: {} -&gt; vaccine: {}&#39;.format(age,vaccine))

**국어, 영어, 수학 점수를 입력하고 평균이 70점 이상이면 True를 출력하는 코드를 작성해 보자. (단, 과목별 점수가 최소 60 이상인 경우에 True를 출력한다.)
pass_score1 = 70
pass_score2 = 60

kor = int(input(&#39;국어 점수: &#39;))
eng = int(input(&#39;영어 점수: &#39;))
math = int(input(&#39;수학 점수: &#39;))

avg = (kor + eng + math)/3
avg_result = avg &gt;= pass_score1

result_kor = kor &gt;= pass_score2
result_eng = eng &gt;= pass_score2
result_math = math &gt;= pass_score2

subject_result = result_kor and result_eng and result_math

print(&#39;평균: {} -&gt; 결과: {}&#39;.format(avg, avg_result))
print(&#39;과락 결과: {}&#39;. format(subject_result))
print(&#39;최종 결과: {}&#39;.format(avg_result and subject_result))</code></pre><h3 id="operator-모듈">Operator 모듈</h3>
<h4 id="산술-연산자-관련-함수">산술 연산자 관련 함수</h4>
<p>덧셈: print(&#39;{} + {}: {}&#39;.format(num1, num2, operator.add(num1,num2)))
뺄셈: print(&#39;{} - {}: {}&#39;.format(num1, num2, operator.sub(num1,num2)))
곱셈: print(&#39;{} * {}: {}&#39;.format(num1, num2, operator.mul(num1,num2)))
나눗셈: print(&#39;{} / {}: {}&#39;.format(num1, num2, operator.truediv(num1,num2)))
나머지: print(&#39;{} % {}: {}&#39;.format(num1, num2, operator.mod(num1,num2))) #나머지
몫: print(&#39;{} // {}: {}&#39;.format(num1, num2, operator.floordiv(num1,num2))) #몫
제곱: print(&#39;{} ** {}: {}&#39;.format(num1, num2, operator.pow(num1,num2))) #8의 3승</p>
<h4 id="비교-연산자-관련-함수">비교 연산자 관련 함수</h4>
<p>같다: print(&#39;{} == {}: {}&#39;.format(num1, num2, operator.eq(num1,num2)))
같지 않다: print(&#39;{} != {}: {}&#39;.format(num1, num2, operator.ne(num1,num2)))
초과: print(&#39;{} &gt; {}: {}&#39;.format(num1, num2, operator.gt(num1,num2)))
이상: print(&#39;{} &gt;= {}: {}&#39;.format(num1, num2, operator.ge(num1,num2)))
미만: print(&#39;{} &lt; {}: {}&#39;.format(num1, num2, operator.lt(num1,num2)))
이하: print(&#39;{} &lt;= {}: {}&#39;.format(num1, num2, operator.le(num1,num2)))</p>
<h4 id="논리-연산자-관련-함수">논리 연산자 관련 함수</h4>
<p>AND: print(&#39;{} and {}: {}&#39;.format(flag1, flag2, operator.and_(flag1,flag2)))
OR: print(&#39;{} or {}: {}&#39;.format(flag1, flag2, operator.or_(flag1,flag2)))
NOT: print(&#39;not {}: {}&#39;.format(flag1, flag2, operator.not_(flag1)))</p>
<p><em>실습</em></p>
<pre><code>**random과 operator 모듈을 사용해서 10부터 100까지의 난수 중 십의 자리와 일의 자리가 각각 3의 배수인지 판단하는 코드 만들기**
import random

random = random.randint(10,100)

num10 = operator.floordiv(random,10)
num1 = operator.mod(random,10)

print(&#39;난수: {}&#39;.format(random))
print(&#39;십의 자리: {}&#39;.format(num10))
print(&#39;일의 자리: {}&#39;.format(num1))

print(&#39;십의 자리는 3의 배수이다: {}&#39;.format(operator.eq(operator.mod(num10,3),0)))
print(&#39;일의 자리는 3의 배수이다: {}&#39;.format(operator.eq(operator.mod(num1,3),0)))</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[[제로베이스 데이터 분석 스쿨 2기] DAY1 ]]></title>
            <link>https://velog.io/@shrimp_park/DAY1-2024.01.03</link>
            <guid>https://velog.io/@shrimp_park/DAY1-2024.01.03</guid>
            <pubDate>Wed, 03 Jan 2024 09:24:49 GMT</pubDate>
            <description><![CDATA[<h2 id="python">Python</h2>
<h4 id="python의-특징">Python의 특징</h4>
<p>무한 정수 처리가 가능하다.
문법 구조가 쉽다.
다양하고 뛰어난 모듈이 많다. 즉, 다양한 기능 (Library)을 쉽게 사용할 수 있다. </p>
<h4 id="python-실행-및-종료-방법">Python 실행 및 종료 방법</h4>
<p>윈도우키+R -&gt; 명령 프롬프트 실행 후 python 실행
Ctrl+Z or exit(), or 창 닫기로 프로그램 종료</p>
<h4 id="pycharm">Pycharm</h4>
<p>코드 실행 방법: Run 클릭 or Shift+F10
코드 복사 단축키: Ctrl+D
문자 표기 방법: print() 
<img src="https://velog.velcdn.com/images/shrimp_park/post/77363a8e-1518-4489-8508-7fce18f90297/image.PNG" alt=""></p>
<h3 id="변수">변수</h3>
<h4 id="변수를-사용하는-이유">변수를 사용하는 이유:</h4>
<p>데이터를 재사용하기 위한 목적과 프로그램을 보다 효율적으로 관리할 수 있다.</p>
<h4 id="변수-작명법">변수 작명법</h4>
<p><strong>1. 영문 사용하기</strong></p>
<pre><code>myAddress = &#39;서울&#39; -&gt; *권장*
    나의 주소 = &#39;서울&#39; -&gt; *비권장*</code></pre><p><strong>2. 첫 번째는 소문자로</strong> </p>
<pre><code>_클래스의 첫 번째 문자가 대문자이므로 혼동의 여지가 있음_
myAddress = &#39;서울&#39; -&gt; *권장*
MyAddress = &#39;서울&#39; -&gt; *비권장*</code></pre><p><strong>3. 데이터의 의미를 파악할 수 있는 표기법 사용</strong>
<strong>4. 카멜 표기법 or 스네이크 표기법 사용</strong> </p>
<pre><code>customerBankAccount = &#39;123-232-3232&#39;
customer_bank_account = &#39;123-232-3232&#39;
customerbankaccount = &#39;123-232-3232&#39; -&gt; *비권장*</code></pre><p><strong>5. 예약어 (파이썬에서 이미 예약된 단어) 사용 금지</strong>
<strong>6. 언더바 (_)를 제외한 특수문자 사용금지 **
**7. 공백 사용 금지</strong>
<strong>8. 숫자 사용 가능하지만 첫 번째 자리 사용 금지</strong>
<img src="https://velog.velcdn.com/images/shrimp_park/post/88c39fa2-a9a8-4676-a20b-d2e59a84094d/image.PNG" alt=""></p>
<h3 id="자료형-data-type이란">자료형 (Data type)이란?</h3>
<p>효율적인 메모리 사용을 위해 데이터를 정수형, 실수형, 문자(열)형, 논리형으로 구분한 것.</p>
<p><em>자료 타입 찾기: print(type(---))</em></p>
<pre><code>정수 (int): num = 10, score = 85 ----&gt; 메모리가 허용되는 한 무한 사용 가능

실수 (float): pie = 3.14, height = 180.5 ----&gt; 대략 소수점 이하 17~`8번째에서 데이터 손실이 일어남, &#39;&#39;로 묶으면 문자(열)로 인식함

문자(열)(str): country = &#39;Korea&#39;
문자 1개: 문자(char)
문자 여러개: 문자열 (string)

논리형 (bool): exampleResult = True, day_off = False</code></pre><p><img src="https://velog.velcdn.com/images/shrimp_park/post/3d7f891c-1220-46e9-b538-89888f300895/image.PNG" alt=""></p>
<h4 id="자료형-변환이란">자료형 변환이란?</h4>
<p>데이터 타입을 변환하는 것으로 파이썬에서 제공하는 함수를 이용한다. 
문자로 변환: str()
정수로 변환: int()
실수로 변환: float()
논리형으로 변환: bool() --&gt; 데이터값 있음 = True (1)/ 없음 = false (0)
<img src="https://velog.velcdn.com/images/shrimp_park/post/97a6dcc4-2c3f-40c8-8730-351369d8f6ae/image.PNG" alt=""></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[제로베이스 데이터 분석 스쿨 2기] OT 후기]]></title>
            <link>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-OT-%ED%9B%84%EA%B8%B0</link>
            <guid>https://velog.io/@shrimp_park/%EC%A0%9C%EB%A1%9C%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%B6%84%EC%84%9D-%EC%8A%A4%EC%BF%A8-2%EA%B8%B0-OT-%ED%9B%84%EA%B8%B0</guid>
            <pubDate>Wed, 03 Jan 2024 08:26:54 GMT</pubDate>
            <description><![CDATA[<h3 id="제로베이스를-선택하게-된-계기">제로베이스를 선택하게 된 계기</h3>
<h5 id="20가지-산업군별-샘플-프로젝트-취업-100-보장반">&quot;20가지 산업군별 샘플 프로젝트&quot;, &quot;취업 100% 보장반&quot;</h5>
<p>2023년 미국에서의 생활을 마치고 급하게 한국으로 돌아와 취업에 도전했지만, 한국에서의 취업이 생각보다 쉽지 않았다. 석사과정에서 배웠던 데이터 분석의 역량을 키워 데이터 분석가 직무로 취업하기 위해 여러 방법을 조사하던 중 제로베이스 데이터 분석 스쿨에 대한 광고를 접하게 되었다.
20가지의 다양한 산업에 대한 샘플 프로젝트, 개인및 단체 파이널 프로젝트 등을 통해 실제 기업에서 요구하는 다양한 경험들과 역량을 쌓을 수 있을 것이란 기대감에 큰돈을 들여 입과를 선택하게 되었다.</p>
<h4 id="2024년-01월-02일-대망의-첫-ot">2024년 01월 02일, 대망의 첫 OT</h4>
<p>매니저님이 해주셨던 말 중 여러 가지 말들이 와닿았다.
&#39;수료 조건에 목매지 말고 자신의 기준을 높여야 한다.&#39; 
&#39;추운 겨울 동안 남들보다 더 노력해서 누구보다 화창한 봄을 맞이하자.</p>
<p>매니저님의 진심 어린 동기부여 메시지들과 함께 강의에 대한 전반적인 과정 및 슬랙 사용 방법 등 4개월의 대장정을 시작하기에 앞서 필요한 정보를 습득하고 마음을 다잡을 수 있는 시간이었다.</p>
<p>최고의 성과를 만들기 위해, 최선을 다해보자 :)</p>
]]></description>
        </item>
    </channel>
</rss>