Your question is almost impossible to understand. Is it A, D or Z which has 'value' .8237 ? In your code, you are comparing sorted(dictionary.values()), which is a list, to a float, which is meaningless. Can you explain what you want to do with more details ? If we could see example input and expected output, that would help a lot .
I wonder if there is an error in your program's logic, because you are replacing one letter after another in the for loop, and it seems to me that you should replace all the letters at the same time, but since I don't know the rest of your program, I may be wrong.
Take the first B in your text. It should be replaced by W, but then when the for loop continues, it will replace this W with something else because W comes after B in the alphabet. Each character should be replaced only once. I think the correct way to do this is to use the method string.translate.
**how to solve invalid keystore error in android studio here is error report----------------------->
here is error report--------> error:Error:java.lang.RuntimeException: com.android.ide.common.signing.KeytoolException: Failed to read key palash from store "D:\MyApplication3.idea\workspace.xml": Invalid keystore format ...