You can refactor this a bit to make it more redable. For example, in the code below there are many instances of local_hints[answer]. For another day: it would be nice to have a way to configure how hints get chosen, for example how many random, or change the criteria completely.