13
asjdhjshdajsd
2 10 27
839/ 845
Last seen 1 year ago
Member for 2 years, 7 months, 17 days
Difficulty Normal
Best reviews / Newest reviews
Using count()-H0r4c3 1 1
Nice solution! But maybe you can express this in a shorter way? return t > f does the same as if t > f: return True else: return False Also, do the counted items really need to be stored in their own variables? You could just calculate them within the comparison like More
First-robertabegg 1
Great solution! You can actually shorten it even further by using list comprehension: for i in range(0, len(items), size): yield items[i:i+size] could become yield [items[i:i+size] for i in range(0, len(items), size)] thus being shorter and far more readable. More
count False and True in items with count_method-muru78gp01 1 1
Great solution! return False if items.count(False) >= items.count(True) else max(items) does the same as return items.count(False) <= items.count(True) P.S. Don't forget to delete your print statements! More
O'REILLY - "Chunk" (One-line version)-jsg-inet 1 1
Great solution! But I think that should rather belong to the "clear" category, shouldn't it? More
First-nimay
Great solution, clear and concise. But you missed some bonus points by not using a lambda and instead opting for def. Anyways, that's just my preference. More
First-vkolev
if len(items) == 0: return items if size > len(items): return [items] is actually not necessary, these edge-cases are taken care of by the range function (if you specify range(0, 0, 4) it would not return anything, thus generating an empty list). Still, great solution! More
First-liuq901 1
Great solution! But maybe use a lambda? (just for bonus points, def actually works better in a production environment) :-) More
First-maruka89 1
Great solution! Maybe it could be shortened by using list comprehension? result = [] if items != []: for i in range(0,len(items),size): result.append(list(items[i:i+size])) return result could become [items[x:x+size] for x in range(0, len(items), size)] More
First-Alex46046
nice! maybe use a lambda to shorten the code? More
Single line-katnic
That's a really short one! Well done, couldn't really add anything of value to that. More
Character checking-frankiser
maybe integrate all these checks to the final return? More
First-Wojtek_Okularczyk
Looks good, but maybe use a lambda instead of def and return? Anyways, that's really clean an well-structured, good job! More
First-njlafxbkfuh 1
Why have you set the variable password as the variable pw? You could just modify the def at the top if you don't want to have long variable names. And, while looping through a list of pw definitely works it isn't really as clean as using other methods like map() or any(). More
First-plutasnyy
Looks good! Though you might want to use list comprehension. More