31
Andrey Solomatin
Last seen 1 year ago
Member for 11 years, 2 months, 8 days
Difficulty Normal
If you change regexpr to '\w\w+' no need to check **len** in **check**
Use generator expressions. It makes code faster and more readable. And you can avoid creating new variable
# count = []
# for i in text:
# count.append(check(i))
# print(count)
# retur
More
Why you use **lambda**?
Use **in** to check element present in collection.
Pyhton slice notation has argument step.
Variable name should tell as about its content, what can tell us this set of names: **l o s e w ne no ve vo ce co ch**
More
You can use empty string in fillvalue.
"reform" is little tricky.
Why you put **import** inside function body?
More
Why generator? Is simple function is more suitable for case then need first result?
More
Number of garbage comments too damn high.
If someone place comments to task template that does not mean you should place them to solution.
More
checkio_1: no: **result =** yes: **return**
checkio_2: no: **for pair in specif** yes: **for val, word in specif**
checkio_2: no **if result != []:** yes: **if result:**
More
Article about FizzBuzz from Jeff Atwood (Stack Overflow creator)
http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html
More
Use **number % 15** instead of nested **if**, It will make code more flat.
More
PEP8: While sometimes it's okay to put an if/for/while with a small body on the same line, never do this for multi-clause statements. Also avoid folding such long lines!
Rather not:
if foo == 'blah': do_blah_thing()
for x in lst: total += x
while t < 10: t = delay()
Definitely
More
PEP8: For sequences, (strings, lists, tuples), use the fact that empty sequences are false.
Yes:
if not seq:
if seq:
More
I suggest you to use hints: This task can be solved using Lists indexes, Slices and Built-in Function "sum".
More
no: **if s.isalpha() == True:** yes: **if s.isalpha():**
you can replace **if s.isdigit() == True:** to **else:**
More
no: **if len( args ) == 0** yes: **if not args**
no: **argslist = list( args ); argslist.sort()** yes: **argslist = sorted(args)**
Why you need abs?
More
line 14: http://www.checkio.org/forum/post/1618/proper-way-to-check-if-sequence-is-empty/
More