def normalize(name): def toUpperCase(x): if ord(x) >= 97: return chr(ord(x) - 32) else: return x def toLowerCase(x): if ord(x) < 97: return chr(ord(x) + 32) else: return x def joinStr(x, y): return x + y return toUpperCase(name[0:1]) + reduce(joinStr, map(toLowerCase, name[1:]))
Sign in to make a reply
余张的故事