定义class类,想输出其中表达的内容,输出方式有哪几种表达?
class PyLanguage:
name = “Python语言中文网”
add = “http://c.biancheng.net/"
def int(self, name, add):
self.name = name
self.add = add
def out(self):
print(self.name,”的网址为”, self.add)
say = PyLanguage()
say.out()
推荐文章: