![]() |
![]() |
#12 |
Jan 2017
2·73 Posts |
![]()
Guess I'm too used to using the Python shell only through IPython. In IPython, a line with semicolons will only show the return value from the last statement (and the semicolon-using solutions here do not work), whereas plain Python shell will handle semicolon-separated statements as basically independent input lines - each will produce independent output, but '_' for example will refer to the return value of the last only.
BTW if anyone is using Python through its plain shell, I recommend trying IPython. I think things like multi-line block support are especially useful - if you write a loop with multiple lines, it's in the command history as one object, and you can easily repeat it with one part edited (instead of recalling each single line individually as the default shell would require). |
![]() |
![]() |
![]() |
#13 |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
17×383 Posts |
![]() |
![]() |
![]() |
![]() |
#14 |
Dec 2016
23×3×5 Posts |
![]()
OK, so you were looking for something like
1e666+1e666j;_*_;_*_;1e666-1e666j;_+1e666j;-1e666+1e666j;_-1e666j;-1e666-1e666j;_+1e666 Or, to make it even shorter and less readable: j=1e666;e=3E333J;e+j;_*_;_*_;j-e;_+e;e-j;_-e;-j-e;_+j |
![]() |
![]() |
![]() |
#15 | |
Sep 2017
13110 Posts |
![]() Quote:
(inf+infj) (nan+infj) (nan+nanj) (inf-infj) (inf+nanj) (-inf+infj) (-inf+nanj) (-inf-infj) (nan-infj) |
|
![]() |
![]() |
![]() |
#16 |
If I May
"Chris Halsall"
Sep 2002
Barbados
2·52·211 Posts |
![]()
To share something fellow geeks might enjoy... The Worst Programming Language Ever - Mark Rendle - NDC Oslo 2021
|
![]() |
![]() |
![]() |
#17 |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
145578 Posts |
![]()
A shorter version:
i=1e666;k=1e666j;i+k;i-k;k*-1j;-i+k;-i-k;k*1j;i+i*1j;i-i*1j;i-k*-1j |
![]() |
![]() |
![]() |
#18 | ||
Dec 2016
1708 Posts |
![]() Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#19 |
Apr 2010
22·3·19 Posts |
![]()
If the order doesn't matter this is shorter:
a=666e666;b=666e666j;a+b;-_;_+a;-_;a-b;-_;_-b;-_;_-a And it should be obvious how to strip 4 more charakters. Last fiddled with by Gimarel on 2022-05-03 at 15:12 Reason: 2 charackters less |
![]() |
![]() |
![]() |
#20 |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
17×383 Posts |
![]()
The order doesn't matter.
"... should look like this." isn't the same as "... shall be this." IMO. IIUC "like" means similar, not exact. At least in this context. I know there are other meanings of "like", but most of those would just make the sentence look weird. |
![]() |
![]() |
![]() |
#21 |
Sep 2017
131 Posts |
![]()
Sorry, my bad. I took it literally including the order of the output.
|
![]() |
![]() |
![]() |
#22 |
May 2022
18 Posts |
![]()
my solution:
i=0+9e+999j;r=9e+999;r+i;r-i;r+i-i;-r+i;-r-i;-r+i-i;r-r+i;r-r-i;r-r+i-i it's a cool problem for a codegolf, I wonder what is the shortest possible solution |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Complexity of Chinese Remainder Theorem | carpetpool | Miscellaneous Math | 4 | 2017-02-09 19:26 |
What is the time complexity of base conversion? | Mr. P-1 | Computer Science & Computational Number Theory | 5 | 2013-04-02 15:47 |
Complexity analysis of 3 tests | kurtulmehtap | Math | 10 | 2013-03-20 14:15 |
Complexity of LLT | T.Rex | Math | 9 | 2007-05-29 21:15 |
complexity of Pepin's test | ixfd64 | Math | 14 | 2005-12-01 22:50 |