16
Radek Brich
Last seen 4 years ago
Member for 9 years, 10 months, 8 days
Difficulty Normal
The variable names in Czech reminded me of the school years :-) Besides those variable names (those should be in English), there are too many levels of if-else.
I would make it more tabular for better readability - for example you can chain the conditions:
if int(prvek) <= 3:
...
More
Thanks for pointing out the ineffective implementation of `fnmatch()` in CPython. I won't use it anymore :-) I (wrongly) believed it just calls [fnmatch(3)](http://man7.org/linux/man-pages/man3/fnmatch.3.html), at least on POSIX systems.
Regarding your code, the `re.compile()` does not help at all
More
1. The first condition can be written as:
if any(x == 0 for x in sorted_sides):
Or, it can be left out entirely, because if one of the sides is zero, the second condition is also True.
2. The `pow(a, 2)` function call can be replaced by `a*a` or `a**2`, which are faster (and shorter to
More
Your solution is perfect. I was aiming for similar one, but did not really manage it that well.
More