题解 | #简单密码#

简单密码

http://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac

mima = input()
mima1 = []
for i in mima:
    if i.isupper() == True and i !='Z':
        mima1.append(chr(ord(i.lower())+1))
    elif i.islower() == True:
        if i in 'abc':
            mima1.append('2')
        elif i in 'def':
            mima1.append('3')
        elif i in 'ghi':
            mima1.append('4')
        elif i in 'jkl':
            mima1.append('5')
        elif i in 'mno':
            mima1.append('6')
        elif i in 'pqrs':
            mima1.append('7')
        elif i in 'tuv':
            mima1.append('8')
        elif i in 'wxyz':
            mima1.append('9')
    elif i == 'Z':
            mima1.append('a')
    else:
        mima1.append(i)
print(''.join(mima1))
全部评论

相关推荐

kyw_:接好运
点赞 评论 收藏
分享
评论
1
收藏
分享
牛客网
牛客企业服务