Twisted (1) 썸네일형 리스트형 twisted counter 연습문제 http://krondo.com/?p=1333 여기에서 제시한 연습문제를 풀어봤다. 왠지 깔끔하지 않아보이는 코드이지만 남겨본다. class Countdown(object): MARKER_REF = '~!@#$%^&*()`,/+_|:;' # a counter is # c[0] : initial value # c[1] : count function counters = [ ] def add_counter(self, c, d): M = self.MARKER_REF marker_string = M[c%len(M)]*3 + M[d%len(M)]*3 idx = len(self.counters) def count(): if sum(map(lambda x : x[0], self.counters)) == 0: react.. 이전 1 다음