EPAM Systems interview question

Python code database query and anagram program