Python implementation of a simple expert system