Skip to main content

Timeline for Sort-a-number. Sorta

Current License: CC BY-SA 3.0

15 events
when toggle format what by license comment
Mar 31, 2014 at 10:11 comment added user80551 @AntonioRagagnin Yes it is, but the penalty is for the list it returns, not for using the function itself.
Mar 31, 2014 at 10:10 comment added Antonio Ragagnin Dear @user80551, I may be wrong, but isn't sorted a built-in sorting function?
Mar 31, 2014 at 10:06 comment added user80551 @AntonioRagagnin this game penalize the use of strings and built-in sorting functions) --Nowhere does it say that sorting functions are penalized. The penalty is because the particular sorting function returns a list. The use of that list is penalized. If python had a sorting generator function, there would be no such penalty.
Mar 31, 2014 at 9:47 comment added Alok @AntonioRagagnin: ohhkk,thanks buddy :)
Mar 31, 2014 at 9:45 comment added Antonio Ragagnin Dear @stevieG, your code is legit, but you are sorting a string (rules of this game penalize the use of strings and built-in sorting functions). However your code (including penalities) will take more points than mine: this is why I complained to the author. In fact penalities are so soft that (ironically) they incentivate the use of builtin functions and strings.
Mar 31, 2014 at 9:43 comment added Alok ''.join(sorted(str(n))) .could you please tell me why this won't be considered as an answer?I'm kinda new
Mar 30, 2014 at 15:59 comment added user80551 @kojiro My main issue about print/return is that print is shorter and doesn't require wrappers. I didn't know that you would allow lambda functions. Kind of facepalmed when I read that. Is it correct now?
Mar 30, 2014 at 15:57 history edited user80551 CC BY-SA 3.0
added 89 characters in body
Mar 30, 2014 at 14:47 comment added kojiro Please see note 4. (Although on a specific note, I'm curious why you didn't use a lambda here.)
Mar 30, 2014 at 7:19 comment added user80551 @kojiro Please clarify: Can I use a function that takes the string of the number as an argument(I accept the penalty). Can I use a function that prints instead of returning?
Mar 30, 2014 at 7:15 history edited user80551 CC BY-SA 3.0
deleted 956 characters in body
Mar 29, 2014 at 19:53 comment added kojiro I clarified the game a little above, particularly about using built-in sorts. A generator might be OK, but the Python help (for 2 and 3 both) clearly states raw_input([prompt]) -> string, so sorted(raw_input()) is +10. Also sorted -> new sorted list, so +20. Then, S.join -> string, so +10 again. Slice notation also implies strings, so +10 (anything else supporting slice notation would arguably be +20). So I calculate 73 and 108, respectively.
Mar 29, 2014 at 6:38 history edited user80551 CC BY-SA 3.0
added 269 characters in body
Mar 29, 2014 at 6:26 history edited user80551 CC BY-SA 3.0
added 269 characters in body
Mar 29, 2014 at 6:16 history answered user80551 CC BY-SA 3.0