题解 | #简单密码#
简单密码
https://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac
password = list(input()) for i,value in enumerate(password): if value in ['a','b','c']: password[i] = '2' elif value in ['d', 'e', 'f']: password[i] = '3' elif value in ['g','h','i']: password[i] = '4' elif value in ['j','k','l']: password[i] = '5' elif value in ['m','n','o']: password[i] = '6' elif value in ['p','q','r','s']: password[i] = '7' elif value in ['t','u','v']: password[i] = '8' elif value in ['w','x','y','z']: password[i] = '9' elif value.isupper() and value != 'Z': password[i] = chr(ord(password[i])+1).lower() elif value in ['Z']: password[i] = 'a' print(''.join(password))