39
CDG.Axel
18 36 55 Leader of the month
9398/ 9695
Axel
Last seen 1 month ago
Member for 2 years, 9 months, 4 days
Difficulty Normal
Best reviews / Newest reviews
complex is better than complicated-veky 1
Thanks for remembering complex numbers for map tasks! It helps to shrink my solution to 10 lines: https://py.checkio.org/mission/lantern-river/publications/CDG.Axel/python-3/complex-isnt-complex/ More
Army Units-tssrkt777 1 1
It looks like inappropriate using of spec and name for class Army (class variables for instead of local variables). IMO this looks better def train_swordsman(self, name): return Swordsman(self.types['swordsman'], name, self.army, 'swordsman') More
Easy-Marcin_Ramotowski 1 1
what reason of ABC base class if you have no abstract methods? More
try: except:-dbirmajer 1
What is the reason of using "return None"? More
Halloween Monsters-tssrkt777 1 1
Think it won't work with 'jack'*20 or something like this :) Btw it's 362880 variants even with max 9 monsters More
Dataclass + defaultdict-r_tchaik 1
very short, but without abstract. plus you may omit dataclass, field and defaultdict using and simplify your code something like that: cuisine, order = tuple(), [0, 0] def add_food(self, food_amount, food_price, dish=0): order[0] += food_amount * food_price def add_drink(self More
Unlucky Days one line-tssrkt777 1
Some optimization: - sum eats iterable, so [] is unnecessary - you can sum boolean, and need no if-comprehension More
64 chars-Sim0000 1
Great idea with x<=y as implication :) More
Brackets-tssrkt777 1 1
Impressive solution! Btw join eats iterables, so [] inside isn't necessary More
Sum by Type-tssrkt777 1
A task where simplicity better than one-line solution :) More
First-Tinus_Trotyl 1
another solution is reduce from functools (based on your solution) from functools import reduce def check_command(pattern, command): return pattern == reduce(lambda a, b: a * 2 + b.isalpha(), command, 0) More
Sun Angle-tssrkt777 1 1
some optimization: - you may first calculate ans, then control sun visibility with one condition like x <= ans <= y - abs(min) looks superfluous More
Time Converter (24h to 12h)-tssrkt777 1 1
some ideas for one-liner: - f-string - := operator - % operator - hint that 0 or x == x - indexing string with bool to get first or second symbol of string More
Morse Clock-tssrkt777 1 1
first you may use this instead of binar_morze(). In addition you may remove 'bm = '.'*(nums[i] - len(bm)) + bm' def binar_morze(n): return f'{1:04b}'.replace('0', '.').replace('1', '-') second you may to parse source data to 6 variables (it is possible in one line) then use f-string t More
First-themrdaimonlp 1 1
you should use "return bool" instead of if bool: return True else: return False More
Caps Lock-tssrkt777 1 1
Ideas: - up = not up - res+= x.upper() if up else x More
First-Tinus_Trotyl 1
you can replace cycle body to this compat += compat + i.isalpha() More
Geometry Figures-tssrkt777 1 1
Great abstraction and polymorphism using! But for my solution I economize with volume(). I made it non-abstract with 0 result ) More
First-Phil15 1
Great span find and merging cycle! More
One liner - sorting dict items-Pelmen323 1
you can use -x[1] instead of x[1] and omit 'reverse=True' More