31
Cjkjvfnby
● 10 ● 30 ● 43
5274/ 5695
Andrey Solomatin
Last seen 1 year ago
Member for 11 years, 2 months, 8 days
Difficulty Normal
Best reviews / Newest reviews
'su' + 'm'-papernode
If you use variable once and in return statment, just return result return eval('su' + 'm')(data) More
split-veky 1
Lines sorted by time, no need to sort them again. sorted(log_text.split("\n")) More
First-Amachua
Python list are not optimized to pop(0) # remove element form begin, you should avoid this in cycles. Replace it with for or reverse list and use pop() # remove element from end. For each line of log you traverse over all other lines in log. It is to complex. You can break on time_delta more the More
First-jcg
It is better to accumulate string it list and join them at the end. res = [] .... res.append(...) return '\n'.join(res) More
First-Miszo
It is not pythonic to assign lambda to variable, it is better to define it same style as parseLog. You can skip parenthesis in that case: # (time, username, URL) = single_log_text.split(";;") time, username, URL = single_log_text.split(";;") More
Pedantic-htamas
Huge work, some part of it does not covered by checkIO tests. you can simplify hexdigits by removing [A-F], segments are already in lowercase. More
Regular Expressions-PositronicLlama
PATH_LOWER has no sence. authority variable can be replaced by host. no need to convert port to int, it used only as string. More
Third-pjwerneck
Good work, same idea as mine. But I deside to use nested functions instead of class. This methods are unused: edist, i2c, c2i More
First-chuckbot
Code looks very bulky. It is hard to read. Just some quites form PEP8: Always surround these binary operators with a single space on either side: assignment (=), augmented assignment (+=, -= etc.), comparisons (==, <, >, !=, <>, <=, >=, in, not in, is, is not), Booleans (and, or, not). Comp More
BFS-bryukh 1
Simple and efficent. But did you realy need to return **U**? More
First-bryukh 1
IMHO **as** in import is usefull only then you have namespace conflicts like: from gzip import open as gz_open In other cases it is adds entropy to code. Current task say "The result is a float from 0 to 1 with two digits precision." you have three. return round(float(prob(bl More
First-twins_gejigeji
When I see string like that: [e[0]-1,e[1]+1,e[2]*e[0]/(e[0]+e[1])] I dont want to understand logic. To avoid such mess you can use unpacking: for white, black, step in container: if white == 0: And please read about python style (PEP8). See python documentation for functions y More
First-bukebuer
It is common practice to use _ for dummy variable name. I prefer to use __ because _ used in I18N as alias to gettext. I dont shure it is good to hardcode values, maximum possible rotation = (1 + s1 + s2) * 180 for b1 in [0.0, -360.0, 360.0, -720.0, 720.0]: If you need to unpack More
Recursive-htamas 1
lru_cache has huge overhead for small functions. Does it increase speed? More
First-jonatan
String has count too, noo need to list it. See round in build-in functions. More
First-aikoven
you can join *check_diagonal* and *check_rows_and_cols* to one function More
The manual way-snipsi
You can use python syntax to simpify code: for i in range(len(expr)) for char in expr # itrate over chars in string. if len(brackets) == 0: if brackets: # empty list is False brackets[len(brackets)-1] brackets[-1] # last element is -1 second from end -2 etc. More
First-turtle51
You can use return on length fail. if len(data) < 10: return False Check all function return all((length, num, caps, low)) Please cleanup you code before publish, this comments are invalid. # replace this for solution # Some hints # Just check a More
First-cbrunet 1
V and S are bad variable names for python. For multi line docstrings I prefer to start text from second line. More
Meh-veky 1
yes, real meh. I can't unsee eighty bucks in you solution. :) Did you realy need **else:**? More
1 2 3 4 5 6 7 8 9 10
11
12 13 14 15