Python - 英文加密


sec1 = {chr(ord('a')+i): chr(ord('a')+i-1) for i in range(26) if i % 2}
sec2 = {chr(ord('a')+i): chr(ord('a')+i+1) for i in range(26) if i % 2 == 0}
sec1.update(sec2)
print(sec1)
print(sec2)
s = 'an apple a day keeps the doctor away'
print(s)
ss = ''
for c in s:
    if c != ' ':           # ' 和 ' 之間空一格
        ss += sec1[c]
    else:
        ss += ' '          # ' 和 ' 之間空一格 
print(ss)
us = ''
for c in ss:
    if c != ' ':          # ' 和 ' 之間空一格
        us += sec1[c]
    else:
        us += ' '         # ' 和 ' 之間空一格
print(us)

English writing practice 2025-5/11

After graduating from university and working for several years, I developed the mindset that a job should be related to one’s interests. Peo...