검색 codewar (2) 썸네일형 리스트형 [Codewars] Kebabize Codewars: Achieve mastery through challenge Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com ▶ 문제 : ▶ 내 답안 : import re def kebabize(string): string = re.sub('[0-9]','',string) a = set([0]+[i for i in range(len(string)) if string[i] != string.lower()[i]]+[len(string)]) b = sorted(list(a)) c = [] for i.. [Codewars] Build Tower Codewars: Achieve mastery through challenge Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com ▶ 문제 : ▶ 내 답안 : def tower_builder(n_floors): b = [ '*' + '*'*(2*i) for i in range(n_floors)] for i, v in enumerate(b) : b[i] = ' '*int((len(b[-1])-len(v))/2) + v + ' '*int((len(b[-1])-len(v))/2) return b ▶ 모범.. 이전 1 다음