• [解决方案] pythonchallenge level 1


    http://www.pythonchallenge.com/pc/def/map.html

    g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.

    abcdefghijklmnopqrstuvwxyz

    k+2=m

    o+2=q

    >>>import string

    >>>text="""g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj. """

    -1: >>>rule=string.maketrans(string.ascii_lowercase,string.ascii_lowercase[2:]+string.ascii_lowercase[:2])

    -2: >>>rule=string.maketrans('abcdefghijklmnopqrstuvwxyz','cdefghijklmnopqrstuvwxyzab')

    >>>string.translate(text,rule)

    "i hope you didnt translate it by hand. thats what computers are for. doing it i
    n by hand is inefficient and that's why this text is so long. using string.maket
    rans() is recommended. now apply on the url. "

    >>>a='map'  #apply on the url,url的值是map

    >>>string.translate(a,rule)

    ocr

    http://www.pythonchallenge.com/pc/def/ocr.html

  • 相关阅读:
    Thrust--self-defined(4)
    x86---32汇编(3)---内存寻址模式
    x86---32汇编(2)---局部变量
    x86---32汇编(1)---乘除法
    CUDA--Thrust(3)--List
    CUDA-Thrust(2)--野指针转换
    CUDA-Thrust(1)--函数初始化
    CUDA---Thrust(0)--初始化
    python(13)--Numpy的安装
    20200930 day24 刷题记录
  • 原文地址:https://www.cnblogs.com/hsp401/p/4474161.html
Copyright © 2020-2023  润新知