题解 | #提取不重复的整数#
简单密码
http://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac
alpha_num = {'abc': 2, 'def': 3, 'ghi': 4, 'jkl':5, 'mno': 6, 'pqrs': 7, 'tuv': 8, 'wxyz': 9}
while True:
try:
pwd = list(input())
for i in range(len(pwd)):
for key in alpha_num:#先将小写字母转换成数字
if pwd[i] in key:
pwd[i] = str(alpha_num[key])
break
if pwd[i]>='A' and pwd[i]<='Z':#对大写字母进行规则转换
pwd[i] =chr(((ord(pwd[i])+1)-65)%26+65).lower()
print(''.join(pwd))
except:
break