Python Count Repeated Characters In String Python Replace