Created
July 10, 2012 12:42
-
-
Save bmispelon/3083030 to your computer and use it in GitHub Desktop.
Incrementing in python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lambda i: i++ (lambda j: j()**j())(type(i)) | |
| lambda i: (sum(range(x))*2)/x # decrement | |
| lambda i: 2*i-(sum(range(i))*2)/i # banermatt | |
| lambda i: __import__('functools').partial(i.__add__, 1)() | |
| lambda i: i+(i is i) # SFJulie1 (kind of) | |
| lambda i: int((x-1j**2).real) | |
| lambda i: int(__import__("os").popen("perl -e'++($a=%d)&&print$a'"%i).read()) # SFJulie1 | |
| lambda i: int((lambda x: x('subprocess').check_output([x('sys').executable, '-c', 'print %d++1'%i])))(__import__) | |
| lambda i: i-(lambda t: int(t.time()-(t.sleep(1),t.time())[1]))(__import__('time')) # Idea by SFJulie1 | |
| lambda i: -~i # Brian (reddit) | |
| lambda i: len(__import__('re').sub('(.)$', '\\1\\1', '1'*i)) # lost-theory (reddit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment