1.5 KiB
Dice Lab Assessment
Everything works as expected. Nice work!
Checkpoint 1
Looking for the sequence endpoints in is_three_of_a_kind
is clever. (You could leave off lines 43 and 44 if you want;
every function implicitly returns nil
in absence of another
value. But some people prefer to be exlicit.
Checkpoint 2
The content of your docstrings looks good. However, most are above their function rather than inside it. This technically works, but defeats some of the purpose of docstrings, as there are automated tools that use them and expect to find them in the right place.
Checkpoint 3
It's interesting to see your developing thinking here--the strategy used in FullHouse seems quite a bit cleaner, and could be applied to 3 of a kind and 4 of a kind goals as well.
Comments
Python OOP is just different enough from Java's syntax that it's driving me crazy, but I'm still having fun. Honestly I always looked
:)
Regarding the self.faces().sort()
error, this is a common frustration for folks newer to,
Python and it represents an inconsistency in the standard library API which is probably too
late to fix. Generally, we expect methods to return something, but list.sort()
sorts
the list in-place, but doesn't return a value. The builtin function sorted()
might provide
more intuitive behavior.
I also appreciated your thoughts on the value of writing documentation. Could be interesting to look into the history of literate programming.