12
Vladimir Fedorovich
Last seen 8 years ago
Member for 10 years, 4 months, 18 days
Difficulty Normal
eval is cool :)
can be more puzzled:
checkio = lambda num: eval('*'.join([n for n in str(num) if n != '0']))
More
great, but you can simplify it without using if-else statement:
def checkio(words):
return re.search(r'[a-z]+\s[a-z]+\s[a-z]+', words, re.IGNORECASE)
More
From one side it's cool, because your algorithm is O(1),
but it's completely unreadable, so such solution only applicable for any "do and forget" tasks. :)
More
In if condition args == False if empty and True if not.
So you can use "if args: return 0"
More
Right implementation, with small remarks:
1. You don't need to compare all cases in the first "if" statement. Just compare the max side with the sum of the rest.
2. Instead of using for loop, use just round(angle_a)
:)
More
to make it puzzled, use sorted(), instead of list.sort():
sorted(set.intersection(set(first.split(',')),set(second.split(','))))
More
list(iterated_object) will be enough and python will do all dirty job :).
So in your case it's list(zip(*matr))
More
Why don't you want to use r as a string instead of using another one array?
Anyway, perfect solution, btw: r.append(c * (number // n)) - good trick, will know about it :)
More
Does it work? It seems you have to use double slash here digits.append(k*(data/v))
More