18
Riddick
6 19 36
1889/ 1945
Last seen 9 months ago
Member for 9 years, 6 months, 20 days
Difficulty Normal
Best reviews / Newest reviews
First-soloshowing
You may write if-else in a one line, for example: return text if text[-1] == '.' else text + '.' More
My first answer-yuta0613
Looks good, maybe will be better change 5 strings of code in one, for example: return array[n]**n if len(array) >= (n+1) else -1 And a little refactoring you can check len(array) without more or equal but only more, e.g.: return array[n]**n if len(array) > n else -1 More
First-margot
You may write in one line: return True if all(elem == list[0] for elem in list) else False More
First-ki1ler
You may change a some part of code for more readable. For example, you may check to %15 firstly and return str(number) in the else block code: if number % 15 == 0: return 'Fizz Buzz' ... else: return str(number) More
All-Sioul
Interesting approach, I recommend to look on builtin library `string` with property `ascii_lowercase` More
First-Arahabakan
What do you think about recursion? More
Use an end range that is half the desired sum-kkkkk 1
Interesting solution, But I think with `while` will be more clear More
First-novelworm 1
You may not use 0 in data[0:limit] It will be like data[:limit] More
First-ElisaZeneli 1
Please use lambda function instead nested function. Thanks! Nice solution! More
one_line-wii_caiji
Maybe the shortest solution that I saw. More
First-spiros738
You can merge in one line of code. More
Sort 'name', then 'price'-armandolios
Why do you use `list.sort(data, key = lambda k: k["name"])` ? You can use only this one `list.sort(data, key = lambda k: k["price"], reverse = True)`. list.sort - not obviously will be nice avoid this construction. More
First-snowd2020
Please merge 2 lines of code in one and it will be nice! More
First-hkgok1
You can use all logic inside try/except. try: st = text.index(begin) + len(begin) except: st = 0 And the same for end case. More
First-JayLee 1
try solve this task with [list comprehension](https://docs.python.org/3.4/tutorial/datastructures.html#list-comprehensions) More
One-liner-suic 1
Perfect solution with lambda ) More
Non-unique Elements-barochpatrik
You used the extra checking ( len(data) == 0 ). In prerequisite is written that **0 < len(data) < 1000** More
First-Tengwu
If using list comprehension will be quickly and shortly. Good luck! More
First-DanielHunnicutt
Good solution! Try using list comprehension. More
First-tartavull
Try using sort-method and length/2. And you can don't use 2.0 when divide two numbers. More
1
2