__MagicPower
Do one thing and do it best!

导航

 

2015年12月2日

摘要: >>>'abc' + 'def''abcdef'Python分别为'abc'和'def'分配了空间,当进行连接操作时,Python自动为新的字符串'abcdef'分配了空间>>>s = 'abc'>>>s = s + 'def'>>>s'abcdef'上面的例子中,看上去我们把'abc'赋给了s,然... 阅读全文
posted @ 2015-12-02 16:19 __MagicPower 阅读(182) 评论(0) 推荐(0) 编辑
 
摘要: while i < len(myString): print 'character %d is:'%myString[i]length = len(myString)while i < length: print 'character %d is:'%myString[i]for oth... 阅读全文
posted @ 2015-12-02 13:56 __MagicPower 阅读(158) 评论(0) 推荐(0) 编辑
 
摘要: #!/usr/bin/env python#--*-- coding:utf-8 --*--"""标识符合法性检查,首先要以字母或者下划线开始,后面要跟字母,下划线或者数字这个例子只检查长度大于等于2的标志符"""import stringalphas = string.letters + '_'n... 阅读全文
posted @ 2015-12-02 13:40 __MagicPower 阅读(516) 评论(0) 推荐(0) 编辑
 
摘要: 1. first of all, you need to download the right version of rar for mac os x. the download url:www.rarlab.com2.it is really a pity that the rar is jus... 阅读全文
posted @ 2015-12-02 11:30 __MagicPower 阅读(167) 评论(0) 推荐(0) 编辑
 

2015年12月1日

摘要: Question 0_1: Python 对象。与所有Python对象有关的三个属性是什么?请简单描述Answer:Question 0_2: 类型。不可更改(immutable)指的是什么?Python的哪些类型是可更改的(mutable),哪些不是?Answer:Question 0_3: 类型... 阅读全文
posted @ 2015-12-01 09:15 __MagicPower 阅读(105) 评论(0) 推荐(0) 编辑
 

2015年11月27日

摘要: 来源于Python核心编程第二版本,此随笔只是为了让自己加深印象。环境 OS X Python版本2.7.10 1 #!/usr/bin/env python 2 #--*-- coding:utf-8 --*-- 3 4 'makeTextFile.py -- Create text file... 阅读全文
posted @ 2015-11-27 15:14 __MagicPower 阅读(202) 评论(0) 推荐(0) 编辑