40
suic
16 39 57
9966/ 10664
Last seen 1 day ago
Member for 9 years, 11 months, 4 days
Difficulty Advanced
Best reviews / Newest reviews
First-Pumba_UA 1 1
Hi, 1. Look at _set()_. 2. Line 11 is not Pythonic and you can replace lines 11-13 with: return not my_dict More
First-nastyajeid 1 1
Hi, look _sorted()_ and its `key` parameter. More
First-Pumba_UA
Hi, you can use `*` to unpack `date1` and `date2` e. g.: d1 = datetime.date(*date1) More
First-Pumba_UA
Hi, look at _str.join()_ and _str.replace()_. More
First-Pumba_UA
Hi, 1. What's wrong with `len(args)`? 2. Why not: return len(args) < 2 3. Line 5: You don't need `*`. More
First-Pumba_UA
Hi, 1. `array` is iterable. 2. Look at _extended slices_ and _sum()_. More
First-Leonya 1
Hi, look at _sum()_ and _extended slices_. More
Second-mohamed.amer.tarak 1
Hi, have a look at _filter()_. More
First-mohamed.amer.tarak 1
Hi, Python is not C. I'm not sure if this is speedy, have you measured it? More
First-Zophar78
Hi, you could use _sum()_ with _generator expression_ instead of `for` loop and `result` variable. More
First-Djekke 1
Hi you could use _any()_ instead of that `for` loop. More
First-Djekke 1
Hi, you could use _timedelta.days_ instead of _date.toordinal()_: (date(*date1) - date(*date2)).days More
First-Djekke 1
Hi, when you _str.join()_ first and then _str.replace()_ after, you can do the replacement in one step. More
First-Djekke
Hi, minor thing: In this case, there should be spaces around `=`. More
First-Djekke
Hi, you could `&` instead of _set.intersection()_. More
First-Djekke
Hi, _str()_ is redundant as _bin()_ returns __str__. More
First-Djekke
Hi, you could use _filter()_ for this: return ''.join(filter(str.isupper, text)) More
First-nastyajeid 1
Hi, you don't need that "else cascade" in the end. 1. Instead of `'a' <= x <= 'z'` you can use `x.islower()`. 2. Instead of `'A' <= x <= 'Z'` you can use `x.isupper()`. 3. Instead of `x in b` you can use `x.isdigit()`. 4. Line 14: `if number and u_letter and l_letter:` etc. More
First-nastyajeid 1
Hi, 1. instead of `x.isalpha() and x == x.upper()` you can use `x.isupper()`. 2. instead of concatenating __str__ with `+` you can use _str.join()_. return "".join(x for x in text if x.isupper()) More
First-nastyajeid 1 1
Hi, you can use _generator expression_ with _sum()_: return sum(x in text.lower() for x in words) More