Skip to content

Commit b91953a

Browse files
author
yuseungri
committed
Initial commit
0 parents  commit b91953a

File tree

568 files changed

+176045
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

568 files changed

+176045
-0
lines changed

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeitPython.iml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WhileTest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
print(7 / 2)
2+
print(6 / 2)
3+
print(7.0 / 2.0)
4+
print(2 + 3 * 4)
5+
6+
# Floor division (버림 나눗셈)
7+
print(7 // 2)
8+
9+
print(8 // 2)
10+
print(8.0 // 3)
11+
12+
#round (반올림)
13+
print(round(3.141592, 2))

example.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
def hello(name): #함수의 헤더
2+
print('Hello!!')
3+
print(name)
4+
print('Welcome to Codeit!!')
5+
6+
def print_sum(num_1, num_2, num_3):
7+
print(num_1 + num_2 + num_3)
8+
9+
10+
hello('Seung Ri!!')
11+
print_sum(1, 2, 3)
12+
13+
def multiply_three_numbers(a, b, c) :
14+
print(a * b * c)
15+
16+
multiply_three_numbers(2,3,4)
17+
18+
def get_square(x) :
19+
return x * x
20+
21+
print(get_square(3))

example2/format.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
year = 2021
3+
4+
month = 1
5+
day = 19
6+
7+
print("오늘은 " + str(year) + "년" + str(month) + "월" + str(day) + "일 입니다.")
8+
9+
string_text = "오늘은 {}년 {}월 {}일 입니다."
10+
11+
print(string_text.format(year, month, day))
12+
print("저는 {3}, {1}, {0}를 좋아합니다.".format("박지성", "유재석", "빌 게이츠", '석영주'))
13+
14+
num_1 = 1
15+
num_2 = 3
16+
#.2f f => float, .2 => 소수점 두번째 자리 반올림
17+
18+
print("{0} 나누기 {1}은 {2:.0f}".format(num_1, num_2, num_1 / num_2))
19+
20+
21+
22+
23+

example2/string.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
print('문자열')
2+
print("문자열 문자열")
3+
print('1' + '2')
4+
print('Hello' * 3)
5+
6+
print("I\'m \"excited\" ")
7+
8+
print(" \'응답하라 1988\' 은 많은 시청자들에게 사랑을 받은 드라마예요.")
9+
print("데카르트는 \"나는 생각한다. 고로 존재한다.\" 라고 말했다.")
10+
11+
print("영화 \'신세계\' 에서 \"드루와~\" 라는 대사가 유행했다. ")
12+

example2/typeConversion.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# 형 변환
2+
# 값을 한 자료형에서 다른 자료형으로 바꾸는 것
3+
4+
print(int(1.2))
5+
print(float(3))
6+
7+
print(int("1") + 3)
8+
print(str(3) + str(5))
9+
10+
# 2,607,700
11+
# 2,307,700
12+
# 2,307,700
13+
print(2692400 * 9 + 2607700 + 2307700 + 2307700)
14+
15+
print(10 / 4)

goobBye.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
#코멘트
3+
print('GoodBye world' + '~!!')
4+
print('2' + '5')
5+
print(7 < 3)
6+
7+
x = 16
8+
y = 4
9+
print(x + y)
10+
# 추상화
11+
# 족잡한 내용은 숨기고, 주요 기능에만 집중
12+
13+
# 변수, 함수, 객체
14+
15+
# 변수 = 값을 저장하는 것
16+

hello.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
#내장함수
3+
print(4990)
4+
print(4990 * 2)
5+
print(4990 + 1490)
6+
7+
burger_price = 4990
8+
y = 1490
9+
z = 1250
10+
11+
print(burger_price * 3 + y * 2 + z * 5)
12+
13+
14+

main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
lol = [[1,2,3], [4,5], [6,7,8,9]]
2+
3+
print(lol[0])
4+
print(lol[2][1])
5+
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
import sys
2+
import os
3+
import re
4+
import importlib
5+
import warnings
6+
7+
8+
is_pypy = '__pypy__' in sys.builtin_module_names
9+
10+
11+
def warn_distutils_present():
12+
if 'distutils' not in sys.modules:
13+
return
14+
if is_pypy and sys.version_info < (3, 7):
15+
# PyPy for 3.6 unconditionally imports distutils, so bypass the warning
16+
# https://foss.heptapod.net/pypy/pypy/-/blob/be829135bc0d758997b3566062999ee8b23872b4/lib-python/3/site.py#L250
17+
return
18+
warnings.warn(
19+
"Distutils was imported before Setuptools, but importing Setuptools "
20+
"also replaces the `distutils` module in `sys.modules`. This may lead "
21+
"to undesirable behaviors or errors. To avoid these issues, avoid "
22+
"using distutils directly, ensure that setuptools is installed in the "
23+
"traditional way (e.g. not an editable install), and/or make sure "
24+
"that setuptools is always imported before distutils.")
25+
26+
27+
def clear_distutils():
28+
if 'distutils' not in sys.modules:
29+
return
30+
warnings.warn("Setuptools is replacing distutils.")
31+
mods = [name for name in sys.modules if re.match(r'distutils\b', name)]
32+
for name in mods:
33+
del sys.modules[name]
34+
35+
36+
def enabled():
37+
"""
38+
Allow selection of distutils by environment variable.
39+
"""
40+
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'stdlib')
41+
return which == 'local'
42+
43+
44+
def ensure_local_distutils():
45+
clear_distutils()
46+
distutils = importlib.import_module('setuptools._distutils')
47+
distutils.__name__ = 'distutils'
48+
sys.modules['distutils'] = distutils
49+
50+
# sanity check that submodules load as expected
51+
core = importlib.import_module('distutils.core')
52+
assert '_distutils' in core.__file__, core.__file__
53+
54+
55+
def do_override():
56+
"""
57+
Ensure that the local copy of distutils is preferred over stdlib.
58+
59+
See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401
60+
for more motivation.
61+
"""
62+
if enabled():
63+
warn_distutils_present()
64+
ensure_local_distutils()
65+
66+
67+
class DistutilsMetaFinder:
68+
def find_spec(self, fullname, path, target=None):
69+
if path is not None:
70+
return
71+
72+
method_name = 'spec_for_{fullname}'.format(**locals())
73+
method = getattr(self, method_name, lambda: None)
74+
return method()
75+
76+
def spec_for_distutils(self):
77+
import importlib.abc
78+
import importlib.util
79+
80+
class DistutilsLoader(importlib.abc.Loader):
81+
82+
def create_module(self, spec):
83+
return importlib.import_module('setuptools._distutils')
84+
85+
def exec_module(self, module):
86+
pass
87+
88+
return importlib.util.spec_from_loader('distutils', DistutilsLoader())
89+
90+
def spec_for_pip(self):
91+
"""
92+
Ensure stdlib distutils when running under pip.
93+
See pypa/pip#8761 for rationale.
94+
"""
95+
if self.pip_imported_during_build():
96+
return
97+
clear_distutils()
98+
self.spec_for_distutils = lambda: None
99+
100+
@staticmethod
101+
def pip_imported_during_build():
102+
"""
103+
Detect if pip is being imported in a build script. Ref #2355.
104+
"""
105+
import traceback
106+
return any(
107+
frame.f_globals['__file__'].endswith('setup.py')
108+
for frame, line in traceback.walk_stack(None)
109+
)
110+
111+
112+
DISTUTILS_FINDER = DistutilsMetaFinder()
113+
114+
115+
def add_shim():
116+
sys.meta_path.insert(0, DISTUTILS_FINDER)
117+
118+
119+
def remove_shim():
120+
try:
121+
sys.meta_path.remove(DISTUTILS_FINDER)
122+
except ValueError:
123+
pass
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('_distutils_hack').do_override()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get(var, 'stdlib') == 'local'; enabled and __import__('_distutils_hack').add_shim();
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Run the EasyInstall command"""
2+
3+
if __name__ == '__main__':
4+
from setuptools.command.easy_install import main
5+
main()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pip
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2008-2020 The pip developers (see AUTHORS.txt file)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)