Roberto Bonvallet wrote:

> import urllib
> import re
> urllib.URLopener.version = "Mozilla/4.0"
> 
> def fact(x):
>     r = re.compile(r"%d ! = (\d+)" % x)
>     for line in urllib.urlopen("http://www.google.cl/search?q=%d%%21"; % x):
>         m = r.search(line)
>         if m:
>             return int(m.group(1))


You solution reminds me the web-based WTF calculator.

http://worsethanfailure.com/Articles/OMGWTF-Finalist-05-WTF-Web-Calc.aspx
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to