I'm trying to re-run some of the Python Challenge levels in the second task it is necessary to rearrange the letters alphabetically in the text.
from string import ascii_lowercase as low file=open("pch0.txt","r").read() low=list(low) result = "" for i in file: if i == low[24] or i == low[25]: result += low[int(low.index(i)-24)] if i in low: result += low[int(low.index(i))+2] else: result += i in the end it turns out "i hope you didnt tra" everything seems to be going fine up to the 20th character. And now the second day I can not understand why.
PS in the file "pch0.txt" text
"g fmcd"