摘要:
#!/usr/bin/python# Filename: objvar.pyclass Person: '''Represents a person.''' population = 0 def __init__(self, name): '''Initializes the person's da 阅读全文
posted @ 2017-10-19 00:16
真勇士王小山
阅读(144)
评论(0)
推荐(0)
摘要:
#!/usr/bin/python# Filename: class_init.pyclass Person: def __init__(self, name): self.name = name def sayHi(self): print 'Hello, my name is', self.na 阅读全文
posted @ 2017-10-19 00:09
真勇士王小山
阅读(139)
评论(0)
推荐(0)
摘要:
#!/usr/bin/python# Filename: method.pyclass Person: def sayHi(self): print 'Hello, how are you?'p = Person()p.sayHi()# This short example can also be 阅读全文
posted @ 2017-10-19 00:06
真勇士王小山
阅读(96)
评论(0)
推荐(0)