声明号码返回加密,从加密提取号码

def file():
    num1 = '1234567890'
    pass1 = 'abcdefghlq'
    relation = str.maketrans(num1,pass1)
    iup = input('请输入11位电话号码:')
    # result = iup.translate(relation)
    # print(result)
    if len(iup)==11:
        result = iup.translate(relation)
        print('加密号码为:',result)
    else:
        iup = input('请重新输入11位电话号码:')
        result = iup.translate(relation)
        print('加密号码为:',result)

    pass2 = 'abcdefghlq'
    num2 = '1234567890'
    relation = str.maketrans(pass2,num2)
    iup1 = input('请输入加密内容:')
    result1 = iup1.translate(relation)
    print('电话号码:',result1)

file()
;