16
Анастасія Токарева
Last seen 3 months ago
Member for 3 years, 6 months, 20 days
Difficulty Normal
A rather creative approach to the task! Makes the solution fast and clear indeed
More
Congrats! You have mastered the art of writing the shortest code ever. Looks cool!
More
Quite a unique solution, but a very logical and algorhythmical one. Good job
More
A beautiful code, great job, though it seems a bit flooded with details. I can't understand French comments, but looks good
More
Nice code!
If you want to, you can also shorten your code by using sorted() function:
return sorted(values, key=lambda x: abs(x))
This way you don't have to first sort the values and only then return.
More
Hi! Nice code!
You can simplify it by using string.digits method instead of writing your own digit string:
import string
digits = string.digits
More
Hi! Nice thinking!
You can actually solve this by using the string.digits method or checking if val.is_digit().
More
Hi! Nice code.
If you want to, you can actually shorten it by using the return statement inside of your try and except clauses like this:
try:
return array[n] ** n
except IndexError:
return -1
More
A great code and usage of counters! Looks very organized and effective.
More
Really nice code, but the missing spaces between the operators make it a bit hard to read. Good job
More