파이썬 문제 풀이 중 만난 에러 메시지 1. Object of type set is not JSON serializable list를 set으로 변경하여 return 했을 때 발생 해결 방법 : set을 list() 로 감싸서 return 2. EOL while scanning string literal 오타 있는지 확인 특히 str 주변 3. TypeError: 'builtin_function_or_method' object is not subscriptable [] 연산자를 사용할 수 없음 ([] 을 잘못 썼을 때) 4. Key error 딕셔너리 key가 기존 key에 없을 때 5. EOF Error End of File 입력이 없는데 계속 입력 받을 때 6. python typeerror: 'in..
Language/Python
* replace a.replace("a를":"b로":"n번") a = 'xoxoxoxoxoxoxo' a.replace('xo', '#', 1) print(a) >>> #xoxoxoxoxoxo * 정렬 : sort() a = [2, 1, 3, 4, 5] a.sort() print(a) >>> [1, 2, 3, 4, 5] 내림차순 하는 법 1) a.sort() a.reverse() 2) a.sort(reverse = True)