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-RomanZhyvitski
Hi, try to look at [__set__](https://docs.python.org/3/library/stdtypes.html?highlight=set.intersection#set-types-set-frozenset) in Python. In fact you need to return a sorted set intersection. def checkio(first, second): first = set(first.split(",")) second = set(second.split(" More
First-RomanZhyvitski
Hi, there's a _str.join()_ function, so you don't need the for loop. And consider that __str__ is immutable in Python is immutable. return "".join(i for i in text if i.isupper()) # or: return "".join(filter(str.isupper, text) In fact you don't need the _if_ as what it checks is a pr More
First-RomanZhyvitski
Hi, you can use * to unpack values e. g.: dat1=datetime.date(*date1) More
First-RomanZhyvitski
Hi, reverse=False is redundant as it's the default value. More
First-cierand
And now get rid of joined_string :) More
First-Pyromanser
Ok, and now get rid of unswer, as you don't need it. More
First-skninja
Hi, you can replace lines 5-10 with: return ','.join(list_phrases).replace('right', 'left') More
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-amarshukla
Hi, there's some redundancy in your code: 1. You don't need to iterate over whole `data`. One `isSmall`, `isCaps`, `isLower` True, you don't need to continue. 2. You don't need to check each condition in every iteration. 3. `if...else` of lines 5 and 15 is redundant. def checkio(data): More
First-CaptCalculator
Hi, you could shorten it :) ~~~~ class Friends(): def __init__(self, connections): self.connections = list(connections) def add(self, connection): if connection not in self.connections: self.connections.append(connection) return True return F More
First-CaptCalculator
Hi, sum(word in text.lower() for word in words) could be more efficient. More
First-kenaniah
Hi, the only thing I would change: > `*` list/set/dictionary comprehensions More
First-CaptCalculator 1
Hi, one comment on this. You could write: return sum(a != b for a, b in zip(n, m)) instead of: count = sum([1 for a, b in zip(n, m) if a != b]) ​ return count More
First-Drazzil
Hi, 1. comments make it less readable. 2. it should be `letter not in m_text`. 3. you don't need `pangramtext`: for letter in string.ascii_lowercase: ... More
First-yassai
Hi, 1. You don't need `alpha_..._list` as you could `text.upper()` or `text.lower` and import `ascii_lowercase` or `ascii_uppercase`. 2. etc... More
First-m600
Hi, that if...else is redundant. More
Pangram-Drakange1
Man, what is this? Have you heard about programming? More