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
#!/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