Update 2019-12-25
Update 2019-12-25: the above is wrong in two ways. First, the number of spades is completely determined by the number of the other three suits, and so for s in range(10 - c - d - h)
should not have been included. And second, if you have seven or more of a suit then which lowest cards you have doesn't matter, because by the time you get to them no one else will have any of the suit. Here's a revised solution that fixes these two: