国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

Python OOP Practice

2019-11-06 06:48:36
字體:
來源:轉載
供稿:網友
Some examples to PRactice OOP in Python.
# coding=utf-8""" 	Python OOP practice """#-------------------------# Author: Kun Liu         # Start date: 2017-03-06  # Latest edit: 2017-03-06 #--------------------------# Python 3 Compatiblefrom __future__ import absolute_importfrom __future__ import divisionfrom __future__ import print_functionfrom __future__ import unicode_literals#---------------------------------class test:	count = 0	def __init__(self, name):		self.name = name		test.count += 1	def __del__(self):		test.count -= 1		print("One test class deleted")		print("left class %d"%test.count)class t:	@staticmethod	def test():		print("hello")	@classmethod	def test2(cls):		print("I am t")if __name__ == "__main__":	a = test("Liu")	b = test("Kun")	del(a)	t.test()	t.test2()
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 蓝山县| 万载县| 清新县| 防城港市| 延长县| 海城市| 德兴市| 海林市| 历史| 建湖县| 都昌县| 石阡县| 景宁| 桐城市| 盐津县| 台江县| 丁青县| 遵义县| 平果县| 安阳市| 成都市| 项城市| 舟山市| 乌拉特前旗| 云浮市| 客服| 高要市| 新巴尔虎右旗| 吴忠市| 锦州市| 枞阳县| 浙江省| 威海市| 大渡口区| 五峰| 日土县| 卢湾区| 庄浪县| 邵阳市| 晋中市| 高唐县|