标签:
1.python2x中的input
>>> temp=1 >>> input() temp 1
2. 1)查看对象属性,类属性 2)修改对象属性影响类属性(取决于类属性是否immutable)
class Demo(object): temp=[1,2] attribute=1 d=Demo() print Demo.temp # Demo.__dict__[‘temp‘],d.__class__.__dict__[‘temp‘] print Demo.attribute print d.__dict__ d.attribute=2 d.temp[0]=-1 print Demo.temp print Demo.attribute print d.__dict__
[1, 2] 1 {} [-1, 2] 1 {‘attribute‘: 2} [Finished in 0.1s]
标签:
原文地址:http://www.cnblogs.com/Citizen/p/4560630.html