题解 | #简单密码#

简单密码

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

      
string = input().strip()
def func(string):
    z_list = "abcdefghijklmnopqrstuvwxyz"
    Z_list = z_list.upper()[:25]
    num_list = "0123456789"
    z = str()
    for s in string:
        if s in num_list:
            s = s
        elif s in z_list[0:3]:
            s = "2"
        elif s in z_list[3:6]:
            s = "3"
        elif s in z_list[6:9]:
            s = "4"
        elif s in z_list[9:12]:
            s = "5"
        elif s in z_list[12:15]:
            s = "6"
        elif s in z_list[15:19]:
            s = "7"
        elif s in z_list[19:22]:
            s = "8"
        elif s in z_list[22:26]:
            s = "9"
        elif s in Z_list:
            for j in range(len(Z_list)):
                if s == Z_list[j]:
                    s = z_list[j+1]
        elif s == "Z":
            s = "a"
        z = z + s
    return z
print(func(string))
    

#HJ21#
全部评论

相关推荐

11-01 08:48
门头沟学院 C++
伤心的候选人在吵架:佬你不要的,能不能拿户口本证明过户给我。。球球了
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务