Does the sentence follow the pattern?

Write follows(pattern, sentence) where pattern is a string of letters and sentence is words separated by single spaces. Return True if there is a one-to-one correspondence between letters and words.

follows("abba", "dog cat cat dog")   ->  True
follows("abba", "dog cat cat fish")  ->  False
follows("aaaa", "dog cat cat dog")   ->  False
follows("abc", "dog dog")            ->  False

The point is to practise a two-way mapping where the two sides are different kinds of thing.

def follows(pattern, sentence):
    ...