17
aleksandr.zaytcev
5 17 35
1636/ 1695
Александр Зайцев
Last seen 1 month ago
Member for 7 years, 19 days
Difficulty Normal
Best reviews / Newest reviews
First-reanimator313 2
1. The string does not need to be converted to a list, the string is already iterable. 2. You do not need to do an object tearing if int (num) == 0. readable will be: if int (num)! = 0: item * = int (num) 3. Also, the python has a well-defined construction - A = Y if X else Z In this st More
Using list.append and pop-ant443 1 1
Using "**try except**" in this case is not very correct (bad style), and also slows down the algorithm. It is better to check whether the list is not empty with a construction - ## if not close_order More
Second-colinmcnicholl 1 1
password = '' dimension = len(cipher_grille) for x in range(dimension): password += ''.join([ciphered_password[i][j] for i in range(dimension) for j in range(dimension) if cipher_grille[i][j] == 'X']) cipher_grille = [''.join([cipher_grille[i][j] for i in range(dimension - 1, More
First-delahere
Why use pop ()? Changed array no further where not used. You can get the last element using the index -1 (array [-1]) More
First-Jerry__Zhang
That there would not be a lot of nested if (it's harder to read) conditions you can unite using "and", "or" More
First-bomblebee 1
An interesting solution) The python has a function - isalpha(). With it would be more readable and shorter. More
MtzAbsolutesorting-Moritz_Momediano_Almonacid
It was possible not to create a variable "resultado", but immediately return the result of sorting. More
Check 4 positions in each of 4 directions only-banjoh
Conditions "if" could be done less _if j + 3 <= size-1 and matrix[i][j] == matrix[i][j+1] == matrix[i][j+2] == matrix[i][j+3]: return True_ With the rest by analogy) So it turns out less nesting "if" and accordingly it becomes easier to read. More
First-sheerluck
It was possible to make in one line - bin (number) .count ("1") More
First-grackhack 1
Use _catche_ as part of the logic necessary to calculate the result VERY BAD! In the block _catche_ there should be only error processing More
Sixth-IronPy
Why compare with magic string variables (_if operation == "connection"_)? It's better to write _if operation == "connection"_ Also, you can not do internal _if_ and just _return x and y_ So there are fewer codes:) More
Forth-__denisPY
следуй pip8 https://www.python.org/dev/peps/pep-0008/? textLower-> text_lower sum = sum + 1 -> sum+=1, sum - зарезерверированное слово, используй другое. например sum_worlds отличное решение для c# кода в питоновской концепции можно решить элегантней создать список в котором будут хран More
Second-__denisPY
если нужен индекс при переборе используй enumerate() for index, value in enumerate(): More
First-xy2383
return array[n] ** n if len(array) > n else -1 More
First-xiaoma24
return array[n] ** n if len(array) > n else -1 More
First-brownie57
password = '' dimension = len(cipher_grille) for x in range(dimension): password += ''.join([ciphered_password[i][j] for i in range(dimension) for j in range(dimension) if cipher_grille[i][j] == 'X']) cipher_grille = [''.join([cipher_grille[i][j] for i in range(dimension - 1, -1, More
First-hao.daniel
Why create a list? You can immediately check if there are any values in args and if not then return 0 Otherwise use min and max from args More
First-chenxia
max(args) - min(args) if args else 0 More
First-fatmakyba 1
password = '' dimension = len(cipher_grille) for x in range(dimension): password += ''.join([ciphered_password[i][j] for i in range(dimension) for j in range(dimension) if cipher_grille[i][j] == 'X']) cipher_grille = [''.join([cipher_grille[i][j] for i in range(dimension - 1, More
datetime-arthurdias-trad
Why are so many "if / elif"? the resulting string is a function of strftime("%-d %B %Year %-H hours %-M minutes"), and then you make a replacement( so only two conditions are obtained) More
1
2