python-int-letter

a = [' ',' ','ABC','DEF','GHI','JKL','MNO','PQRS','TUV','WXYZ']
b = {}
for i in range(10):
    b[i] = a[i]
while True:
    c = input('').upper()
    out = []
    if c == '0':
        break
    else:
        c1 = tuple(list(c))
        for c2 in c1:
            for k,v in b.items():
                d = tuple(list(v))
                if c2 not in d:
                    pass
                else:
                    out.append(str(k))
        print(''.join(out))

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务