demo
#!/usr/bin/python
class Person:
name = 'jim'
age = 25 def say(self):
print 'My name is ' + self.name + ', and age is ' + str(self.age) p = Person()
p.say()
print p.name
2024-01-13 19:42:10
#!/usr/bin/python
class Person:
name = 'jim'
age = 25 def say(self):
print 'My name is ' + self.name + ', and age is ' + str(self.age) p = Person()
p.say()
print p.name