[BangPypers] SPOJ: Kamil -> Code Golf
Shashwat Anand
anand.shashwat at gmail.com
Sun Nov 15 07:44:03 CET 2009
I left it. Will try again someday, the quest for perfection or should I say
53 chars should last by then :)
On Sun, Nov 15, 2009 at 11:58 AM, Abhishek Mishra <ideamonk at gmail.com>wrote:
> I tried a lot, I give up. But I noticed this,
>
> if 'foo'.count (sub, [start, end])
> allowed us to place a regexp in place of sub, we could've shortened it.
> But unfortunately we need to import re and compile one before using.
>
> So achieving something like
> foo = 'FILIPEK'
> q=1;foo.gsub(/[DTFL]/){q*=2} p q}
>
> is not possible. In the above ruby code mainly gsub and 'p' as a
> shorthand for print is helping out.
>
> Python is really made for writing readable code :P
> The quest for 53 bytes py code is still on.
>
> regards,
> Abhishek Mishra
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
More information about the BangPypers
mailing list