I passed all tests but one with a quite a quite large difference , and it is not a rounding issue
How can it be possible ?
Edit : found the reason : the n sided polygon is not convex ..... so my code is not adapted
There was quite a similar kata but this one is of 2016 and that is of 2019.
Why is this even voted as best practice? This solution breaks fundamental DRY rule. Repeating code is never best practice.
It was created in python 2, where the output of range() is a list.
In python 3, you need to transform it into a list.
This does not work it just outputs range(1,5) and not 1,2,3,4,5
Not an issue
.pop(0) on a list is really expensive because it requires the array to shift left, an O(n) operation. It would be better to use a collections.deque which can pop the left most item off in O(1) time.
Test case not working...message:
TypeError: 'int' object has no attribute 'getitem'
Yet, when I submit, it passed.
Otherwise, kata quite fun
I've just added more test case, mainly feeding it with the regular polygons up to 100 sides (but with a random side)
I would suggest more extensive tests, also with random cases.
Thank you, I'm modifying the test case
This comment is hidden because it contains spoiler information about the solution