import re 
strings = [
	"python...is...fun...",
	"python...is...fun",
	"python...is...fun??"
]

for s in strings:
	new_text = re.sub(r"(?:\.{2,}|(?<!\.))$", ".", s)
	print(new_text)