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@python.org http://mail.python.org/mailman/listinfo/bangpypers