Enumerate & Zip
@Enumerate -리스트에서 값 추출할 때 인덱스 번호를 같이 추출하는 함수 실습) # Unpacking index and value in list for i, v in enumerate(['tic', 'tac', 'tok']): print(i, v) # 0 tic # 1 tac # 2 tok # Unpacking the index and value in the list and saving it as a list mylist = ['a', 'b', 'c', 'd'] print(list(enumerate(mylist))) # [(0, 'a'), (1, 'b'), (2, 'c'), (3, 'd')] # Make a sentence into a list, unpack the list index and va..
Split & Join
@Split 함수 -String Type의 값을 나눠 List 형태로 반환 -자르는 데에 목적 있음 -뉴스데이터 등에 많이 사용 한 문장에 해당 단어가 얼마나 포함되고 있냐 등 실습) # 빈칸 기준으로 문자열 나누기 items = 'zero one two three'.split() print(items) # "," 기준으로 문자열 나누기 example = 'python,jquery,javascript' print(example.split(",")) # 리스트의 각 값을 a, b, c, 변수로 unpacking example = 'python,jquery,javascript' a, b, c = example.split(",") # "." 기준으로 문자열 나누고 unpacking example = 'dami..