40
suic
16 39 57
9964/ 10664
Last seen 4 days ago
Member for 9 years, 10 months, 19 days
Difficulty Advanced
Best reviews / Newest reviews
First-michal_krk 1
Hi, you do the same thing len(phrases) times, why? def left_join(phrases): output = ",".join(phrases) output = output.replace('right', 'left') return output # is enough. # And now get rid of output variable as you don't need it: return ",".join(phrases).re More
First-michal_krk 1
Hi, what's the point of the for loop? You do the same thing len(args) times. # this is enough: def checkio(*args): if not args: return 0 return max(args) - min(args) More
curse-casilda 1
Hi, ... good, evil... that's funny :) but line 10 isn't: return ",".join(curse) # is enough More
First-OleksiyKhomenko 1
Hi, () around the expression are redundant. More
First-Japijapo
Hi, the print statements are useless. If you really want to comment your code, then _comment_ and don't write print statements like these. More
First-Japijapo
Hi, float division in boolean algebra task, why? 1. Line 13: return x == y 2. Line 11: return x != y 3. Line 7: return x or y 4. Line 5: return x and y Conclusion: You don't need to import math. More
First-Japijapo
Hi, a few comments: 1. You don't the for loop and _Capitals_ variable: return "".join(ListOfCapitals) # str.join() in action 2. You don't need re: # verbose :) res = [] for letter in text: if letter.isupper(): res.append(letter) return "".join(res) More
First-Japijapo
Hi, 1. Look at negative indices: A[len(A)-1] == A[-1]. 2. You don't need to sort A when it's empty. 3. Instead of: if A == []: ... # you can write: if not A: ... More
First-Japijapo
Hi, you can write: S *= int(i) # instead of: S = S * int(i) More
First-Japijapo
Hi, 1. test if string is not a digit/number with try...except, why? # There are methods like # str.isnumeric() or str.isalpha() for that. 2. for each? for w in splitted_words: if w.isalpha(): tf_string += 'True' else: tf_string += 'False' More
First-Japijapo 1
Man, ... else: S = S Why? You don't need that branch at all. Few tips: 1. Negative indices: array[len(array)-1] == array[-1] 2. You can write x += 1 instead of x = x + 1. 3. Look at _sum()_ function. return sum([::2]) * array[-1] More
First-Japijapo 1
Hi, remove print statements before publishing. More
lambda-Tarty 1
Hi, you don't need `[]` and the `..if..else...` in `sum`. More
First-sambdima97 1
Hi, why not? if abc not in text.lower(): return False More
My_House_Password-jcfisk227
Hi, 1. Lines 6-8 are redundant. 2. Lines 13-16 are redundant: return len(a) and len(b) and len(c) # or even return a and b and c 3. You don't the `else` branch on lines 17 and 18. def checkio(password): if len(password) < 10: return False a = re.findall("[a-z]+ More
First-fariik
Hi, you don't need `maxi` and `mini`: return max(args) - min(args) More
Very ungly but it works-a3a3ia3
Hi, it is not so ugly, but it needs some cleanup: 1. You could do it with less parentheses and less steps. E. g. lines 16-18: # Options: s = (len(data) - 1) / 2 # is enough s = int((len(data) - 1) / 2) # merge 16-17 s = data[int((len(data) - 1) / 2)] More
First-Hojo
Hi, this is way to complicated: 1. Look at `^` operator. 2. On line 7 you don't need `[]` and `...if...else` More
First-Hojo
Hi, look at _sum()_ and _extended slices_, e. g. `sum(array[::2])` More
First-Hojo
Hi, 1. __str__ is iterable. So `text = text.lower()` is enough. 2. It should be `x not in text`. 3. You could use _any()_ built-in function for this mission. More