@@ -0,0 +1,746 @@
+# -*- coding:utf-8 -*-%0Aclass Solution:%0A    # @return a string%0A    def countAndSay(self, n):%0A        say = '1'%0A        for x in xrange(n-1):%0A            count = 0%0A            ret = %5B%5D%0A            prev = None%0A            for bit in say:%0A                if prev != bit:%0A                    if count:%0A                        ret.append(str(count))%0A                        ret.append(prev)%0A                    count = 1%0A                else:%0A                    count += 1%0A                prev = bit%0A            if count:%0A                ret.append(str(count))%0A                ret.append(prev)%0A            say = ''.join(ret)%0A        return say%0A%0A%0Aif __name__ == '__main__':%0A    s = Solution()%0A    for n in xrange(10):%0A        print n, s.countAndSay(n)%0A

add leetcode Count and Say.