Determine if a string has all the same characters: Difference between revisions

Content deleted Content added
Hout (talk | contribs)
→‎{{header|Python}}: Added a functional draft in Python
Hout (talk | contribs)
m →‎Functional Python: (Edited a docstring)
Line 278:
# firstDifferingCharLR :: String -> Either String Char
def firstDifferingCharLR(s):
'''Either thea firstmessage characterreporting (ifthat any)no that differscharacter fromchanges
thewere characterseen, ator the headfirst ofcharacter string,(if orany) athat messagediffers
reportingfrom that nothe character changesat the head wereof seenstring.
'''
groups = list(groupby(s))