Notice
Recent Posts
Recent Comments
Link
«   2026/06   »
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
Archives
Today
Total
관리 메뉴

학습기록남기기

2022_07_01_Python_3일 본문

수업_정리

2022_07_01_Python_3일

backend_na 2022. 7. 1. 17:12

함수- 모듈 내부에서 공용적으로 사용할 수 있는 기능의 집합(단독 호출 가능)

  • 파이썬은 각각의 데이터 타입으로 된 내장 함수를 제공

메서드- 클래스에 소속된 함수로 ,특정 자료형에서만 사용 가능한 함수

# 함수 
len() 
del()

# 문자열 메서드
a='abca d | ef'

a.find('a')
a.rfind('a')
a.count('a')

in 키워드 :True or False

'a' in a
'b' not in a

a.isdecimal()
a.isalpha()
a.islower()
a.isupper()

a.replace('기존문자열','대체할 문자열')
a.replace('기존문자열','대체할 문자열',개수)

a.split() # 공백을 기준으로 분할  [ ' ' , ' ' ,...]
a.split(' | ')

a.strip()
a.rstrip()
a.lstrip()

a.lower()
a.upper()
a.swapcase()
a.capitalize()
a.title()
#list
a=[]
a=list()

a=[1,2,3,'a','b','c']

a.append(value)
a.insert(index,value)

a.remove(value)

del(a[index])

a.clear()
#dict

d={}
d=dict()

d={'key':'value'}
students={'멍멍이':'김철수','야옹이':'박영희','쨱짹이':'홍길동'}

print(students['멍멍이'])

students['김']='검'

stduents['멍멍이']='김수철'

students.keys()
students.values()

del(students['멍멍이'])

#tuple

p=(1,2,3,4,5,6)
p=1,2,3,4,5,6


numbers - int , float ,complex ,boolean

sequence - str,list,tuple

map - dict

set

none

'수업_정리' 카테고리의 다른 글

2022_07_05_Python_5  (0) 2022.07.05
2022_07_04_Python_4일  (0) 2022.07.04
2022_06_30_Python_2일  (0) 2022.06.30
2022_06_29_Spring_19일  (0) 2022.06.29
2022_06_28_Spring_18일  (0) 2022.06.28