python学习笔记 一

今天学了python的类。。

给个最简单的例子(综合了所有关于类的基本知识):

class Person:

	def setName(self,name):
		self.name=name

	def getName(self):
		return self.name

	def sysHello(self):
		print 'hello,',repr(self.name)

	def _cannotSee(self):
		print 'sorry '+self.name+', you can not see it!'

class Woman(Person):
    del sex(self):
      self.sex="woman"

 

此篇博文 未完成。。。待续 

原文地址:https://www.cnblogs.com/ben-zuo/p/3578989.html