Python Frequency Analysis Substitution