[프로그래머스] 문자열 다루기 기본 python # 문제 : https://school.programmers.co.kr/learn/courses/30/lessons/12918 # s.isdigit() = 문자열이 숫자 형태 인지 # s.isalpha() = 문자가 알파벳만으로 구성 인지 # s.isalnum() = 알파벳+숫자 인지 def solution(s): if len(s) == 4 or len(s) == 6: return s.isdigit() else: return False 공부 서랍장/알고리즘 공부 2022.09.17
[프로그래머스] 모의고사 python # 문제: https://school.programmers.co.kr/learn/courses/30/lessons/42840 def student_answer(answers): student_1,student_2,student_3 = [],[],[] #수포자1,2,3 정답지 설정 tmp = [1,2,3,4,5] for i in range(0,len(answers)): student_1.append(tmp[i%5]) tmp = [2, 1, 2, 3, 2, 4, 2, 5] for i in range(0,len(answers)): student_2.append(tmp[i%8]) tmp = [3, 3, 1, 1, 2, 2, 4, 4, 5, 5] for i in range(0,len(answers)): stude.. 공부 서랍장/알고리즘 공부 2022.09.06
[프로그래머스] 오픈채팅방 python # 문제 https://school.programmers.co.kr/learn/courses/30/lessons/42888 global dic dic = {} def nick_name_update(ID,nick_name): ## 닉네임 저장 dic[ID] = nick_name return def solution(record): answer = [] tmp_answer = [] ## 닉네임 업데이트 by dict for i in record: action = i.split(sep=' ') if action[0] == 'Enter': nick_name_update(action[1],action[2]) tmp_answer.append([action[0],action[1]]) elif action[0] == '.. 공부 서랍장/알고리즘 공부 2022.09.06