s = "A man, a plan, a canal: Panama".lower() b = ''.join(ch for ch in s if ch.isalnum()).lower() print(b)