22
DahliaSR
7 23 46
2682/ 2945
Dahlia Ramm
Last seen 1 year ago
Member for 8 years, 1 month, 3 days
Difficulty Normal
Best reviews / Newest reviews
The most numbers-wccalvin 1
+ Line 2 is useless. _args_ is of type tuple and since you do not need to modify the values it contains it makes no sense to change the type to list. + line 3: if len(given_args) > 0: ==TO==> if args: ==> much more pythonic In another solution you used try - except! Can you think of a way to More
looping-richshelswell 1 1
Line 5: if word in text.casefold(): This if-statement is inside the for-loop, so text.lower() is called on **every** iteration. Creating a variable like “text_lower” outside of the for-loop and assigning text.lower() to it would be more effective. More
First-delta.varphi 1
I would recommend to get rid of line 2 and change line 4 to: for i in words.split() this saves a line of code. Be careful when using str.split(" ") instead of str.split(). More
First-sodalite 1
A bit too complicated! Why not deleting lines 1 and 11 to 13 and changing line 8 to: try: return array[n] ** n That's lss 4 lines of code and no import and does the same. More
not first, wont be last-greg.p.mueller 1 1
- bin(number) returns a string ==> no need for type casting - does it make sence to get rid of the frist 2 characters in the string returned by bin(number)? will those 2 characters ever effect the result when you use count('1')? More
First-Iriskin 1 1
smarter would have been to: - use _max()_ instead of _sorted()_ - use _key=data.count_ - when using _sorted()_, use _[-1]_ instead of reversion More
First-Jaybreez17 1 1
Clear! You can improve your solution by apllying the [EAFP coding style](https://docs.python.org/3/glossary.html#term-eafp). This means that, instead of explicitly checking if _n_ is a valid index for _array_ you simply assume that it is and in case an Error is raised you catch it... try: More
First-KWisniewski 1
Line 3: Slicing is not really required, coz the represention will ALWAYS start with "0b", which does not affect the result Line 4: Casting to String is useless as bin() returns a string. More
Simple-Pouf 1 1
Calling _filter_, which calls a lambda, which calls _bin()_... Why not an if statement in the generator? ''.join(chr(c>>1) for c in message if not bin(b).count('1') & 1 More
smn theorem-veky 1 1
Learned something new - again! If I got it wright, using functools.partial() makes most sense if you are actually planning to reuse the partial object? More
First-Sim0000 1
Straight forward! Using an f-string would be worth +2. :D More
Simple-brubru777 1 1
Very nice and clear. Just one small thing: Instead of using this: wall.strip().split('\n') it would be more readable and simpler to use `str.split()`: wall.strip().split('\n') By default `str.split()` splits at any whitespace character and treats consecutive whitespace characters as a s More
Tondo's words-violet.tk 1 1
Nice idea to put line 8 into the if from line 6, as this is the only place where count can increase. But why do break at line 9? Count equals 3, so return True and get rid of line 12 + 13 + 14 and decrease the indentation level of line 15. Line 12: if count >= 3: can count ever become > 3 ? More
First-PythonWithPI 1
Same idea as I had, but a bit more complicate. Line 4 is redundant. Line 5 to 10 can be compressed to: try: return line[:line[:length + 1].rindex(' ')] + '...' except ValueError: return '...' More
First-kurosawa4434 1 1
and one more time... Nice! But why are u using key = lambda x: abs(x) instead of key=abs More
First-byte.kgd 1 1
Line 4: return sum(x for x in array[::2])*array[-1] "x for x in" is reduntant. More
O RLY?-veky 1 2
Hmmm, I was expecting something more special, but I should have known better. :D More
Extreme Python-veky 1 1
This one is great! But I don't get why line 2 does not fail on generators. Usually generators don't have a len attribute and are not subscriptable. More
First-greatdragone75 1
Line 4: if word in text.lower(): This if-statement is inside the for-loop, so text.lower() is called on **every** iteration. Creating a variable like “text_lower” outside of the for-loop and assigning text.lower() to it would be more effective. More
First-Vereena 1
Turning _data_ into a _set_ would prevent from repeatedly counting equal elements. More
1
2
3 4 5 6 7 8 9