最新消息:

Python self

未分类 admin 2605浏览 0评论

[codesyntax lang=”python”]

 class aBc:
	def __init__(sf, aaa, bbb, ccc):
		sf.a3 = aaa
		sf.b3 = bbb
		sf.c3 = ccc
	def a(sf):
		print 'Hello a3 %s' %sf.a3
		print 'Hello b3 %s' %sf.b3
	def c(sf):
		print 'Hello c3 %s' %sf.c3
[/codesyntax]

[codesyntax lang=”python”]

a = aBc(‘askdf’,’3df’,’df3′)

a.a()
Hello a3 askdf
Hello b3 3df

a.c()

Hello c3 df3

[/codesyntax]

====================================================

转载请注明:爱开源 » Python self

您必须 登录 才能发表评论!