I really enjoyed this one. It'd be nice to have similar other ones for different algebraic entities (I've never seen before). Well maybe it would be nice to make them myself if they don't exist....
This comment is hidden because it contains spoiler information about the solution
It would be nice if you give information about the set and the binary operation used for a test, so that the user can debug more easily.
You could still introduce the class in a later stage of the series
Hi, I was thinking I might make it into a series of kata where you add more functions one at a time if this one went down well. I saw that in a Morse code kata and liked the idea. There are other interesting properties of groups that could be interesting to implement like finding subgroups or proving two groups are isomorphic.
Shouldn't group_set be a set rather than a list? Otherwise there can be duplicate elements.
Is it really needed to make a class just to check one thing? A class that serves no purpose but to call a single function using the constructor parameters as its parameters is meaningless. You might as well just turn it into a function is_group(group_set, binary_operation).
(Marking this an issue since inevitably every other language translation will pick this up and it'll be very messy)
No idea how that happened
There's an accidental JS version now...
Good catch! I forgot to change my original code rather than just the template, updated Thanks!
I've come up with three more tests that I think catch, associtivity, lack of identity and lack of an inverse while retaining the other three conditions. Thanks for the advice.
Python sample tests are still using isGroup instead of is_group
Thank you! I don't know how I missed that, I didn't realise that when you press validate soloutions it doesn't check the examples.
I've fixed it.
Thank you for the link, I haven't done much programmaing before so I'm new to style guides. I think I've made it better, following the style for functions and variables.
Naming conventions described in PEP 8 are strongly preferred in Python.