python 创建类的实例对象

 # -*- coding: UTF-8 -*-
class Employee: def __init__(self, name, salary):
self.name = name
self.salary = salary def displayCount(self):
pass
def displayEmployee(self):
pass
"创建 Employee 类的第一个对象"
emp1 = Employee("Zara", 2000)
"创建 Employee 类的第二个对象"
emp2 = Employee("Manni", 5000)
上一篇:一步一步创建ASP.NET MVC5程序[Repository+Autofac+Automapper+SqlSugar](九)


下一篇:hdu-2544-最短路(dijkstra算法模板)