Replace String By Index Python Dictionary Append For Loop