题解 | #简单密码#
简单密码
https://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac
s = input() w = '' l = ("abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz") for i in s: if 97 <= ord(i) <= 122: for j in range(len(l)): if i in l[j]: w += str(j + 2) elif 65 <= ord(i) <= 90: if i != "Z": w += chr(ord(i.lower()) + 1) else: w += "a" else: w += i print(w)