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
Generalized-Imelda
Hi, why not: return ' '.join(w for m, w in MODULI if not number % m) or str(number) # or even: ' '.join(w for m, w in ((3, 'Fizz'), (5, 'Buzz')) if not number % m) or str(number) More
Shortest I could think of-picklesforfingers
Hi, this is more "hard to read" than creative. I'm not a PEP8 dogmatist, but this looks better: def checkio(n): if n % 5 == 0 and n % 3 == 0: return "Fizz Buzz" if n % 3 == 0: return "Fizz" if n % 5 == 0: return "Buzz" return s More
First-jamestotle
Hi, one lambda would be enough. More
FizzBuzz with Lists-victorhfranca
Hi, why not: return " ".join(R) if R else str(number) More
invasive-AndreyDanin
Hi, _counts_ is redundant: return [i for i in data if data.count(i) > 1] More
golf-minto
Great job! Much nicer than mine :) More
List Comprehension Practice-jaburaschi 1
Hi, [] and `...if...else` are redundant. E. g.: return ''.join(w for w in text if w.isupper()) # or even: return ''.join(filter(str.isupper, text)) More
First-Bogdymoto3
Hi, 1. In `checkio` you can use list comprehension: def checkio(data): return [x for x in data if nrre(data,x) > 1] # nrre is like str.count so def checkio(data): return [x for x in data if data.count(x) > 1] More
First-Bogdymoto3
Hi, _bin()_ returns __str__ and it has a _str.count()_ method, so you don't need that for loop: return bin(number).count('1') More
First-0x41
Hi, `value` is redundant. With a list comprehension and _len()_, or with _sum()_ it could be shorter and nicer. More
First-0x41
Hi, 1. __str__ is immutable so it's not the best type in this case. 2. _filter()_ or generator expression + "".join() would be better, e. g.: return filter(str.isupper, text) More
First-0x41
Hi, don't reinvent the wheel. Look at _str.join()_: return "".join(phrases).replace("right", "left") More
First-0x41
Hi, you can unpack _date1_ and _date2_ with `*`. More
First-0x41
Man... are you serious? But with a funny name it could be `Creative` solution? Anyway that last if is redundant: return count == 26 # shorter: import string return all(x in text for x in string.ascii_lowercase) More
First-Bogdymoto3
Hi, 1. you can write: if x not in text.lower(): return False return True 2. Instead of `abc=...` you can `import string` and use `string.ascii_lowercase`. More
List Comprehension Practice-jaburaschi 1
Hi, [] and ...if...else are redundant. You can write: return sum(w in text.lower() for w in words) More
First-Bogdymoto3
Hi, once result is True, you don't need to continue. In fact you don't need `result` at all: if eu >= 3: return True return False More
QuadVar PassCheck-20sahilg
Hi, 1.that last `if` and all the `== True` checks are redundant e. g.: return all((a, b, c, d)) 2. `data.split()` does nothing. 3. All `range (0, len(data) - 1)` are redundant: for x in data: ... etc. More
First-Johnnie
Hi, that `else` is redundant: if length == 0: return 0 for e ... : ... return ... This way of doing it is too tedious Tips: Look at: # 1. extended slices. array[::2] # even elements # 2. negative indices: array[-1] # last element for non More
First-Johnnie
Hi, 1. the last `if... else` is redundant: return "111" in wordArray 2. Consider that fact that __str__ is immutable. 3. Once `"111" in wordArray` you don't need to continue: for phraze in wordList: ... if "111" in wordArray: return True return False More