For Loop Over String Python Replace Substring