8
Last seen 1 year ago
Member for 12 years, 9 months, 3 days
Difficulty Normal
But why
import collections
and not
from collections import counter
when this is the only item you use from there?
More
Well done! I did not expect this to work with empty lists as well. :D
More
The comment should be inside the function it comments on.
Also, if you feel you need to explain you one-letter-length variables, then maybe use longer and more descriptive names to begin with.
More
You can combine your two if-statements into one with the "and", like you did in the second line anyway.
Also, if you have a pattern like this:
if check_something and something_else:
return True
else:
return False
You can cut it short into th
More
You can replace
if digit == 0 or upper == 0 or lower == 0:
like this
if 0 in (digit, upper, lower):
More
You can change this:
"for i in range(len(data)): x = data[i]"
directly to
"for c in data: x = c"
More