본문 바로가기

분류 전체보기551

CNN [ Sun, Mar 17,2019 ~ Sat.Mar 24,2019 ] [2019-03-17 Sun] 49 dead in terror attack at New Zealand mosques Headline : Aftermath of a massacre Terror attack on mosques: At least 49 people were killed and 20 seriously injured, in a hate-filled terror attack targeting two mosques in the New Zealand city of Christchurch.The suspect: The shooter, identified as 28-year-old Australian citizen Brenton Harrison Tarrant, has been charged with mur.. 2019. 3. 17.
[Python] 유용한 파이썬 기능 1. 복수개의 특정문자열이 존재하는지 확인 >>> find_str = ['a','b','c'] >>> any(x in 'cdef' for x in find_str) # 'cdef'에 'c'가 존재하므로 True True >>> any(x in 'def' for x in find_str) # 'def'에 'a','b','c' 중 하나도 없으므로 False False >>> all(x in 'cafba' for x in find_str) # 'a','b','c' 가 모두 존재하므로 True True any 함수는 하나라도 존재하면 True, all 함수는 모두 존재하면 True 2. 진법전환 1) base진법의 num을 10진법으로 전환. num은 문자열이어야 함. int(num,base) 2) 10진법의 .. 2019. 3. 10.
CNN [ Sun, Mar 10,2019 ~ Sat.Mar 16,2019 ] [2019-03-10 Sun] White House obsession: Trump can't shake Cohen Washington (CNN)Even as he goes about his job, the claims levied by President Donald Trump's former attorney Michael Cohen have become a preoccupation for the commander in chief, who has angrily rebutted some of the allegations while casting his onetime fixer as a liar. The President's aides and allies say he has raised Cohen consta.. 2019. 3. 10.
Python 자료형 SORT [List, Tuple, Dictionary] 파이썬 자료형의 정렬 1. iterable.sort()와 built-in sorted() 함수 list_a = [3,5,7,8,2,6]print(list_a.sort()) # None : list 의 sort는 정렬기능만하고 return이 없다print(list_a) # [2, 3, 5, 6, 7, 8] : list_a가 정렬 list_b = [3,5,7,8,2,6]print(sorted(list_b)) # [2, 3, 5, 6, 7, 8] : sorted는 정렬된 값을 return한다print(list_b) # [3, 5, 7, 8, 2, 6] : 원래 list_b는 변경되지 않는다. tuple_a = (3,5,7,8,2,6)#print(tuple_a.sort()) # Error. tuple은 impu.. 2019. 3. 6.
[Python] 문자열 함수 1. 문자열 반복 >>> 'abc'*10'abcabcabcabcabcabcabcabcabcabc' >>> [123, 456]*2[123, 456, 123, 456] 2. 문자열 관련 함수 1) lstrip(), rstrip(), strip() - lstrip([char]) : char는 optional. char가 없으면 좌측 공백을 삭제. 있으면 그 문자를 좌측에서 삭제- rstrip([char]) : char는 optional. char가 없으면 우측 공백을 삭제. 있으면 그 문자를 우측에서 삭제- strip([char]) : char는 optional. char가 없으면 양측 공백을 삭제. 있으면 그 문자를 양측에서 삭제 * 주의 strip 계열의 함수는 문자열의 양쪽만 처리가 가능. 중간은 처리가.. 2019. 3. 3.
MIT OCW - Introduction to Computer Science and Programming in Python - Lecture 06 Lecture 06. RECURSION, DICTIONARIES 이 글은 Mit Open Courseware(OCW)에서 공개한 교육자료이며 OCW의 라이센스정책을 따릅니다. License : Common Creative License : BY-NC-SA (저작자표시-비영리-동일조건변경허락) 출처 : https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/lecture-slides-code/MIT6_0001F16_Lec6.pdf 1. RECURSION 1) Recursion(재귀)이란 - 알고리즘 .. 2019. 2. 24.