I was doing a problem KAMIL : https://www.spoj.pl/problems/KAMIL/ and the shortest version i came up with was :
>>> for i in range(10):t=raw_input();print 2**sum(t.count(i)for i in'DFLT') This is 71 character long. >>> s = "for i in range(10):t=raw_input();print 2**sum(t.count(i)for i in'DFLT')" >>> len(s) 71 However the best solutions in python ( https://www.spoj.pl/ranks/KAMIL/lang=PYTH%202.5 ) shows that it can be reduced to 53 character long. Do anyone here had solved this problem or have an idea as to how to shorten the code any more ? I'm still clueless. _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers