defcapitalize_sentense(s,sep=None): return (sep or' ').join(x.capitalize() for x in s.split(sep))
defcapitalize_the_first(s): return s.capitalize()
defmain(): s = 'Et mollJJDKitia et iJJDJkdn. digKKDJnissimos kdjkdjHHSJ.' out = capitalize_sentense(s,sep='. ') print(out) out = capitalize_the_first(s) print(out)
if __name__ == "__main__": main()
Here’s a little trigger. we split them first, then capitalize them.