40
Last seen 4 days ago
Member for 9 years, 10 months, 19 days
Difficulty Advanced
Hi,
1. Line 17 is redundant.
2. Instead of lines 13-17 you could write: `return c == 3`
More
Hi, look at _filter()_ built-in and the _str.join()_ method.
return "".join(filter(str.isupper, text))
More
Hi,
1. `round(float())`s are redundant.
2. You can handle the `len(args) == 0` case with `try..except` but there are more elegant ways.
More
Hi. A small note: Using dictionary instead of if .. elif .. else could save you some typing.
More
It's nice and short. I was surprised that even the last line is shorter than 80 characters. :) Good job!
More
This solution is for demonstration purposes ([see](https://py.checkio.org/forum/post/10113/help-please/)).
More
Hi,
1. Line 2 is redundant: __tuple__ is iterable.
2. Line 3 and 4 are redundant: `return ','.join(x).replace('right', 'left')`
Regards,
suic
More
Hi,
1. Instead of lines 10-14 you can write: `return sum(x[0]!=x[1] for x in zip(*(map(int, i) for i in (x, y))))`.
2. Look at `^` (alias `xor`) operator.
Regards,
Gabriel
More
Hi, I have a few comments:
1. That `if..else` and the `password` variable are redundant. Btw. line 3 doesn't make much sense.
2. Expression in parentheses can contain line breaks. It looks better than `\`. (see below)
3. Finally: You don't need `re`. Look at [string methods](https://docs.python.or
More
Hi, few comments:
1. _addup()_ is redundant.
2. You can write:
if condition:
return x
else:
return y
# like this:
return x if condition else y
[Here](http://www.checkio.org/mission/restricted-sum/publications/suic/python-3/sabinas-shortened/)'s a shortened versi
More
Hi,
1. _issufix()_ is redundant see [_str.endswith()_](https://docs.python.org/3.5/library/stdtypes.html?highlight=str.endswith#str.endswith)
2. `is not` and `!=` don't do the same thing (look at [this](https://docs.python.org/3.5/library/stdtypes.html#comparisons))
3. Instead of:
if word1 is
More
Hi,
1. look at the _sum()_ builtin:
sum(int(digit) for digit in xnorm)
2. In fact, you just need to count the number of "1" in xnorm, therefore:
return bin(n^m).count('1')
More
Hi,
1. You use `stringnumber` only once, so you don't need it.
2. You could write `multtotal *= digit`.
3. `if digit:` is enough.
More