log = print
def find(s1, s2):
r = -1
for i in range(len(s1)):
c = s1[i]
if c == s2:
r = i
break
return r
s = input('请输入你要加密的密码:')
def encode3(s, shift):
lower = 'abcdefghijklmnopqrstuvwxyz'
r = ''
for i in range(len(s)):
c = s[i]
index = find(lower, c)
if index == -1:
r = r + c
else:
index = index + shift
r = r + lower[index % len(lower)]
print('您加密前的密码:', s)
print('您加密后的密码:', r)
encode3(s, 4) # 调节加密程度