A word is said to be univariate when all its
letters are the same. For instance ’xxx’ is an
univariate word. Write a function @has_univariate_word(f)@ that given a
list
of nonempty strings of lowercase letters, returns
True when
contains an univariate word. The function returns
False if
has no univariate words.
Important condition. Solutions employing position-wise indexed access to the argument of the function (as in @f[i]@) are not accepted.
>>> has_univariate_word(['xxyxx', 'aaaab', 'ba', 'open', 'close']) False >>> has_univariate_word(['car', 'd']) True >>> has_univariate_word(['xxx' , 'window']) True >>> has_univariate_word([]) False