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-tlemur
Hi, you don't need bool. Try in Python REPL: >>> number = 1 >>> type(number % 3 == 0) # it's already a bool More
First-DarkhanShakhanov 1
Hi, first of all I don't want to discourage you. It's nice that you use __str__ methods instead of _re_ :) I would show you some of the beauty of Python. With a basic set of built-in functions you can avoid a lot of noise and code duplication. 1. You don't need the "else-cascade" :) def ch More
First-lukas.solil
Hi, you don't need _re_, look at _str.isdigit_ or _str.isnumeric_. More
sum-TomTerebus
Hi, you don't even need _def_ or _lambda_ :) More
First-pietertolsma
Hi, 1. there's quite a lot of duplication there. On lines 4-9 you do two times the same thing. 2. You don't the convert ..._words to lists. __str__ is iterable: def verify_anagrams(first_word, second_word): first_word = first_word.strip().lower() second_word = second_word.str More
First-makstheimba
Hi, you don't need try...except. You don't even need _if_ :) More
First-bundgaard
Hi, what is the point of line 7, 8? You also don't need the _numbers_ (_args_ is iterable), _vmax_ and _vmin_ variable. This is enough: def checkio(*args): if len(args) >= 2: return max(args) - min(args) else: return 0 More
The Most Numbers-jaen
Hi, look at _min()_ and _max()_ built-ins. More
clear-hrs1985
Hi, sorry but this solution is for thumbs down. 1. To many _ifs_. return len(args) and max(args) - min(args) # that's all 2. All the else: pass branches are pointless. You don't need them. 3. Why this way?: if len(args) == 0: return 0 elif len( More
First-Martin.N.Menendez 1
Hi, you can write: if not arg: return 0 More
First-grigoriytretyakov 1
Hi, else branch and bool are redundant ... I've played with that a bit. [Here](http://www.checkio.org/mission/house-password/publications/suic/python-3/grigoriytretyakovs-shortened-using-evil-eval/) is the result. More
First-JulienRialland
Hi, in fact you don't need _re_ for this mission. You can replace for loop with _all()_ and _if_ with _and_: return len(data) > 9 and all(re.search(r, data) for r in ('[0-9]', '[A-Z]', '[a-z]')) More
First-f-osorio
Hi, you don't need the lambda. _abs_ is a function and _key_ has to be a function: return sorted(numbers_array, key=abs) More
First-RohitKulkarni
Hi, __set__ is iterable so set(data) is enough. More
MySolution-RohitKulkarni
Hi, you don't need the last if: return second in friends[first] # is enough More
First-JohnScira
Hi, simpler way to express line 4: if i in text.lower(): ... More
Solution for "Binary count"-Dronimo 1
Hi, _bin()_ returns __str__ so _str()_ is redundant. More
First-BevenNyamande
Hi, d is redundant: return [num for num in data if data.count(num) > 1] More
First-BevenNyamande
Hi, you don't need the tuple: more, less = max(args), min(args) # and in fact you don't need more and less return max(args) - min(args) More
Second - lambda + reduce-dubkc
Hi, in this case you don't need lambda. You can import mul from operator or basically use int.\_\_mul\_\_: return reduce(int.__mul__, [int(x) for x in str(number) if x!= '0']) # another approach: return reduce(int.__mul__, filter(None, map(int, str(number)))) More