Univariate words X97337


Statement
 

pdf   zip

html

Write a boolean function is_univariate_word(s) that given an string s returns True if and only if s is formed using only one letter. For instance word xxXxXXx is univariate but xxXxy is not. We assume s is non empty and all characters of s are letters.

Sample session
>>> is_univariate_word('xxXxxxXX')
True
>>> is_univariate_word('xyyyyYYY')
False
>>> is_univariate_word('y')
True
>>> is_univariate_word('yyyyx')
False
Information
Author
ProAl
Language
English
Official solutions
Python
User solutions
Python