Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #57726

Re: Obfuscated factorial

From Vito De Tullio <vito.detullio@gmail.com>
Subject Re: Obfuscated factorial
Date 2013-10-27 08:28 +0100
References <526badb4$0$29972$c3e8da3$5496439d@news.astraweb.com> <CAN1F8qXvmk2ity6YD82jyfAUdEu3oF48i_9PGXYcjA1W3awyGw@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1641.1382858920.18130.python-list@python.org> (permalink)

Show all headers | View raw


Joshua Landau wrote:

> Python already supports the factorial operator, -ⵘ.

why use ⵘ (TIFINAGH LETTER AYER YAGH) when you can have the BANG? 방 (HANGUL 
SYLLABLE BANG)


> You just have to
> import it.
> 
> # Import statement
> ⵘ = type("",(),{"__rsub__":lambda s,n:(lambda f,n:f(f,n))(lambda
> f,z:round((2.5066282746310002*(z+0j+7.5)**(z+0.5)*2.718281828459045**(-
z-7.5)*(0.99999999999980993+676.5203681218851/(z+1)-1259.1392167224028/(z+2)+771.32342877765313/(z+3)-176.61502916214059/(z+4)+12.507343278686905/(z+5)-0.13857109526572012/(z+6)+9.9843695780195716e-6/(z+7)+1.5056327351493116e-7/(z+8))).real)if
> z>=0.5 else
> 3.141592653589793/(__import__("math").sin(3.141592653589793*z)*f(f,1-
z)),n)})()

I'm really, really impressed!

-- 
By ZeD

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Obfuscated factorial Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-26 11:55 +0000
  Re: Obfuscated factorial Vito De Tullio <vito.detullio@gmail.com> - 2013-10-26 14:50 +0200
  Re: Obfuscated factorial Chris Angelico <rosuav@gmail.com> - 2013-10-27 00:26 +1100
  Re: Obfuscated factorial Joshua Landau <joshua@landau.ws> - 2013-10-26 16:32 +0100
  Re: Obfuscated factorial Tim Chase <python.list@tim.thechases.com> - 2013-10-26 10:35 -0500
  Re: Obfuscated factorial Gene Heskett <gheskett@wdtv.com> - 2013-10-26 10:13 -0400
  Re: Obfuscated factorial Vito De Tullio <vito.detullio@gmail.com> - 2013-10-27 08:28 +0100

csiph-web