주제: 장현 김의 개인 회의실 Zoom 회의 참가 https://pknu.zoom.us/j/3383832014?pwd=dGV0dDY1UnlzUmxjOStxWmNLQzBOZz09 회의 ID: 338 383 2014 암호: 1234
# 0 <= a < 3 -의 개념과 같음 앞에는 같고 뒤보다는 하나 작음
a = 'Life is too short, You need Python'
print(a[8]+a[9]+a[10])
print(a[8:11]) # 8보다 크거나 같고 11보다 작다 8 <= a < 11
print(a[23:27])
print(a[0:27])
print(a[:27]) # 0은 생략 가능
print(a[28:]) # 끝까지 출력
print(a[:]) # 처음부터 끝까지 뒤에 :1이 생략
print(a[::1]) # 위와 동일
print(a[::2]) # 처음부터 끝까지 2개씩
print(a[::-1]) # 거꾸로
too
too
need
Life is too short, You need
Life is too short, You need
Python
Life is too short, You need Python
Life is too short, You need Python
Lf stosot o edPto
nohtyP deen uoY ,trohs oot si efiL
# 문자열 삽입 join *
# 배열[리스트], 튜플을 문자로
print(','.join('abcdefg'))
a,b,c,d,e,f,g
print(','.join(['a','b','c','d','e']))
a,b,c,d,e
# 문자열 바꾸기 replace **
a = 'Life is Egg'
c = a.replace('Egg','Beautiful')
print(a)
print(c)
Life is Egg
Life is Beautiful
# 문자열 나누기 split *
# 뮨자열을 배열로
a = 'Life is Egg'
aa = a.split()
print(a)
print(aa)
b = 'Life-is-Egg'
bb = a.split('-')
print(b)
print(bb)
Life is Egg
['Life', 'is', 'Egg']
Life-is-Egg
['Life is Egg']
ex = 'abcdefghi'
ex2 = ex.split()
print(ex2)
ex_join = '='.join(ex)
print(ex_join)
ex_split = ex_join.split('=')
print(ex_split)
ex_replace = ex_join.replace('=','*')
print(ex_replace)
['abcdefghi']
a=b=c=d=e=f=g=h=i
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']
a*b*c*d*e*f*g*h*i
GitHub https://git-scm.com/ 들어가서 설치하기 64bit로 설치