Notice
Recent Posts
Recent Comments
Link
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- slow and steady
- promise
- Import
- js
- Project
- https://youtube.com/playlist?list=PLuHgQVnccGMA5836CvWfieEQy0T0ov6Jh&si=FTaYv8m21EhO-A2K
- webpack
- ๊ฒ์
- addEventListener
- execCommand
- mysql
- Porject
- async
- ajax
- json
- JS #ํ๋ก์ ํธ
- prj
- db
- ์ฐธ๊ณ ๋ธ๋ก๊ทธ
- https://m.blog.naver.com/tt2t2am1118/221010125300
- ๋๊ธฐ
- database
- setTimeout()
- eport
- object
- sql
- ๋น๋๊ธฐ
- ํผํ
- await
- callback
Archives
- Today
- Total
C-log
Welcome to Python : ๋ฌธ์์ด ์๋ฃํ ๋ณธ๋ฌธ
728x90
- ๋ฌธ์์ด ์๋ฃํ : https://hi-code.tistory.com/110
- ๋ฆฌ์คํธ ์๋ฃํ : https://hi-code.tistory.com/111
- ํํ ์๋ฃํ : https://hi-code.tistory.com/112
- ๋์ ๋๋ฆฌ ์๋ฃํ : https://hi-code.tistory.com/113
- ์งํฉ ์๋ฃํ : https://hi-code.tistory.com/114
Title | Code | Console |
๋ฌธ์์ด ์๋ฃํ | ||
๊ธฐ๋ณธ ๋ฌธ์์ด ๊ตฌ์กฐ |
"Hello World" 'Python is fun'
|
|
๋ฐ์ดํ๋ฅผ ์ด์ฉํ ์ค ๋ฐ๊ฟ |
multiline = ''' Life is too short
You need python
'''
print(multiline)
|
Life is too short You need python |
๋ฌธ์์ด ์ธ๋ฑ์ฑ |
a = "Life is too short, You need python" print(a[0])
|
L |
๋ฌธ์์ด ์ฌ๋ผ์ด์ฑ |
a = "Life is too short, You need python" slice = a[0:4]
print(slice)
|
Life |
a = "Life is too short, You need python" slice = a[:8]
print(slice)
|
Life is | |
a = "Life is too short, You need python" slice = a[5:7]
print(slice)
|
is | |
๋ฌธ์์ด ํฌ๋งคํ |
format = "I eat %d apples." % 3 print(format)
|
I eat 3 apples. |
format = "I eat %s apples." % "five" print(format)
|
I eat five apples. | |
๋ฌธ์์ด ์ ๋ ฌ๊ณผ ๊ณต๋ฐฑ |
print("%10s" % "hi") |
' hi' |
print("%-10sjane." % "hi") |
hi jane. | |
print("%0.4f" % 3.42134234) |
3.4213 | |
print("I eat {0} apples".format(3)) |
I eat 3 apples | |
print("{0:<10}".format("hi")) |
'hi ' | |
print("{0:>10}".format("hi")) |
' hi' | |
print("{0:=^10}".format("hi")) |
====hi==== | |
y = 3.42134234 print("{0:10.4f}".format(y))
|
' 3.4213' | |
name = 'ํ๊ธธ๋' age = 30
print(f'๋์ ์ด๋ฆ์ {name}์
๋๋ค. ๋์ด๋ {age}์
๋๋ค.')
|
3.6ver ์ด์๋ถํฐ ๋์ ์ด๋ฆ์ ํ๊ธธ๋์ ๋๋ค. ๋์ด๋ 30์ ๋๋ค. |
Title | Code | Console |
๋ฌธ์์ด ๊ด๋ จ ํจ์ | ||
count |
a = "hobby" print(a.count('b'))
|
2 |
find |
a = "Python is the best choice" find_b = a.find('b')
find_k = a.find('k')
print(find_b)
print(find_k)
|
14 -1 |
index |
a = "Python is the best choice" find_b = a.index('b')
find_k = a.index('k')
print(find_b)
print(find_k)
|
Traceback (most recent call last): File "...Quiz.py", line 3, in <module> find_k = a.index('k') ValueError: substring not found |
find์ index์ ์ฐจ์ด | find๋ฅผ ์ฌ์ฉํด์ ์กด์ฌํ์ง ์๋ ๋ฌธ์์ด์ ๊ฒ์๋๋ฉด '-1'์ ๋ฐํํ์ง๋ง index๋ error๊ฐ ๋ฐ์ํ๋ค. | |
join |
toJoin = ",".join('abcd') print(toJoin)
|
a,b,c,d |
upper |
a = "hi" print(a.upper())
|
HI |
lower |
a = "HI" print(a.lower())
|
hi |
lstrip |
a = " hi " print(a.lstrip())
|
'hi ' |
rstrip |
a = " hi " print(a.rstrip())
|
' hi' |
strip |
a = " hi " print(a.strip())
|
'hi' |
replace |
a = "Life is too short" print(a.replace("Life", "Your leg"))
|
Your leg is too short |
split |
a = "Life is too short" print(a.split())
b = "a:b:c:d"
print(b.split(':'))
|
['Life', 'is', 'too', 'short'] ['a', 'b', 'c', 'd'] |
728x90
'๐Python' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Welcome to Python : ๊น์ ๋ณต์ฌ ์์ ๋ณต์ฌ (0) | 2023.07.09 |
---|---|
Welcome to Python : ์งํฉ ์๋ฃํ (0) | 2023.07.08 |
Welcome to Python : ๋์ ๋๋ฆฌ ์๋ฃํ (0) | 2023.07.08 |
Welcome to Python : ํํ ์๋ฃํ (0) | 2023.07.08 |
Welcome to Python : ๋ฆฌ์คํธ ์๋ฃํ (0) | 2023.07.07 |
Comments