Python 笔记01| Notes about Python 01

近几日花了挺多时间在这上面,效果也较为显著,PMangar基本被实现了。期间有一些心得在这儿写下来做记录,顺便也分享:
I’ve been working on Python these days and here are some notes for it:

  1. Python中不支持在string.find(str)中使用正则表达式,即str只能是string。
    str in string.find(str) can not be a regular expression, it should be a string.
    Code:

  2. 使用for i in range(a,b)时,i的值可以等于a到不b-1而不会等于b。同理对于i[a:b]会截取i的第a至b-1个元素。
    In Python, any operation involving a range of a to b means the value can be from a to b-1.
    Code:

  3. 当已知一个字符的Unicode编码时,例如a=”u4eba”,可以通过unichr()和int()将其转换为相应字符的Unicode形式即b=”u4eba”
    When you know the unicode number of a charactor, you can get the corresponding character by using unichr() and int().
    Code:

Rotar

4 comments

  1. 雪の嗳嗳ぺ   •  

    @ @…..晕头…..不懂…

    • Rotar   •     Author

      俺看Spanish也是……@_@晕头不懂

  2. 小雪=3=   •  

    你是学计算机嗒? 那些是编程么?好难好复杂啊…你都能背下来?

    • Rotar   •     Author

      是编程的……不过只是兴趣爱好,专业是电子工程OTL

Leave a Reply

Your email address will not be published. Required fields are marked *