Timeline for One Ring to rule them all. One String to contain them all
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 17, 2020 at 9:04 | history | edited | CommunityBot |
Commonmark migration
|
|
Nov 11, 2013 at 19:38 | comment | added | Martin Thoma |
Also: The output length of your first script is 1133 and the second one is 1020 .
|
|
Nov 11, 2013 at 19:29 | comment | added | Martin Thoma |
range(1e3) does not work: Python 2.7:TypeError: range() integer end argument expected, got float. Python 3.2: TypeError: 'float' object cannot be interpreted as an integer
|
|
Nov 7, 2013 at 2:00 | comment | added | r.e.s. |
I find the length of your first program is now 54, not 53, and the second one is 59, not 58. Also, range(999) is enough in the first one -- range(1000) (or range(1e3) ) is not needed -- and the output length is 1133, not 1134.
|
|
Nov 6, 2013 at 22:29 | comment | added | user8777 |
@filmor Made smaller, and smaller again by using 1e3 instead of 1000
|
|
Nov 6, 2013 at 22:28 | history | edited | user8777 | CC BY-SA 3.0 |
smaller
|
Nov 6, 2013 at 17:53 | comment | added | filmor |
And the tip by r.e.s. still help, str(i)*(str(i)not in s) is a bit shorter than i=str(i);s+=[i,''][i in s] ;)
|
|
Nov 6, 2013 at 17:46 | comment | added | filmor |
You can shorten that by one character by using range(999,99,-1) instead of range(1000)[::-1] .
|
|
Nov 6, 2013 at 11:25 | comment | added | Warren P | Wot? They took out backticks? Guido must have been having an I Hate Perl and Everything that Looks like It day when deciding what to keep. | |
Nov 6, 2013 at 2:58 | comment | added | r.e.s. |
I find that your first program has output length 1133, not 1132. In Python 2 (but not Python 3), you can shorten the code to 54 characters by using backticks: for i in range(999):s+=`i`*(not`i`in s)
|
|
Nov 6, 2013 at 0:02 | history | answered | user8777 | CC BY-SA 3.0 |