调用对象里的方法
2017-04-18 本文已影响6人
古寒飞
.#!/usr/bin/python
class Student(object):
def init(self,name):
self.name=name
std=Student(123)
std.name="tay"
print(std.name)
std.name="aaa"
print(std.name)
.#!/usr/bin/python
class Student(object):
def init(self,name):
self.name=name
std=Student(123)
std.name="tay"
print(std.name)
std.name="aaa"
print(std.name)