智一面的面试题提供python的测试题
http://www.gtalent.cn/exam/interview?token=f098f775ffa0106d0451f7fd97357f23

描述符
参考:
Python 描述符简介
使用@property
包装
参考:
http://blog.sina.com.cn/s/blog_93b45b0f0100zfv7.html
python字符串拼接的五种方式
(1).  通过加号(+)的形式
website = 'python' + 'tab' + '.com
python 中使用 + 进行字符串连接的操作效率低下,是因为python中字符串是不可变的类型,使用 + 连接两个字符串时会生成一个新的字符串,生成新的字符串就需要重新申请内存,当连续相加的字符串很多时(a+b+c+d+e+f+...) ,效率低下就是必然的了
 
(2). 方法2:join方法
使用略复杂,但对多个字符进行连接时效率高,只会有一次内存的申请。而且如果是对list的字符进行连接的时候,这种方法必须是首选
 
(3). 字符串格式化,这种方法非常常用,本人也推荐使用该方法
website = '%s%s%s' % ('python', 'tab', '.com')
(4) 直接连接 中间有无空格均可str1 str2
 
website = ('python', 'tab', '.com')
(5) 通过逗号(str1,str2)的形式
 
website = 'python', 'tab', '.com'
第五种方式现在好像不行了
————————————————
我们的python技术交流群:941108876
智一面的面试题提供python的测试题
http://www.gtalent.cn/exam/interview?token=f098f775ffa0106d0451f7fd97357f23