题解 | #简单密码#
简单密码
https://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac
while True: try: # 输入一组密码 str1=input() # 处理密码 l=['abc','def','ghi','jkl','mno','pqrs','tuv','wxyz'] str2='' for i in str1: if i=='Z': str2 +='a' elif i.isupper(): str2+=chr(ord(i)+33) elif i.islower(): for j in l: if i in j: str2+=str(l.index(j)+2) break else: continue else: str2+=i print(str2) except: break