This version and an equivalent full function do the exact same thing; this is just compressing it into one line. There's literally no advantage and it violates PEP-8 but some people seem to think it looks cool.
However, this answer wasn't written to use good coding practices. It was written to show off how short it could be written. :)
I would never write code like this for a real project, just for goofy fun.
I don't get how it works. Can someone explain: a) why is even_or_odd not a function and can nevertheless be called with a number? b) how does this magic bracket work? Thanks in advance :)
oh i see. Thanks for the info. I will read about it.
This version and an equivalent full function do the exact same thing; this is just compressing it into one line. There's literally no advantage and it violates PEP-8 but some people seem to think it looks cool.
This comment is hidden because it contains spoiler information about the solution
wow
haha nice
men i love using lambda ;)
unbelievable !! how you find this idea ):-o
wow!
Thanks actually genius hahah
I need some pills for a headache tho...
Really fun and creative solution!
frrr
Exactly my intentions :')
There is also a complementary explanation for the "magic bracket" below
I don't get how it works. Can someone explain: a) why is even_or_odd not a function and can nevertheless be called with a number? b) how does this magic bracket work? Thanks in advance :)
wOw, looks pretty
Loading more items...