Replace String Using Index In Python Defined