Skip to content

Instantly share code, notes, and snippets.

@uruskan
Created September 3, 2017 15:54
Show Gist options
  • Save uruskan/e10fb07820904c5ecb27f07e0a8b7b57 to your computer and use it in GitHub Desktop.
Save uruskan/e10fb07820904c5ecb27f07e0a8b7b57 to your computer and use it in GitHub Desktop.
Emplooye System
Employees = {
}
class Employee(object):
'Common base for all employes'
empCount = 0
def __init__(self,name,salary,age):
self.name = name
self.salary = salary
self.age = age
Employee.empCount += 1
def displayCount(self):
print ("Total Employee : " , Employee.empCount , "\n")
def displayEmployee(self):
print("Name : ", self.name ," Salary : " , self.salary ," Age : " , self.age, "\n")
print ("NEVER FORGET TO SAVE YOUR CHANGES ! \n")
print ("Press s to save your work ! \n")
print ("Press l to load database. \n")
print ("Press x for adding employee \n")
print ("Press y for show employee count \n")
print ("Press z for display employee \n")
print ("Press q for quitting. \n")
while True :
st = input("->> : ")
if (st == "x"):
eid = input ("Id : ")
eName = input ("\nName : ")
eSalary = input ("\nSalary : ")
eAge = input ("\nAge : \n")
Employees[eid] = Employee(eName,eSalary,eAge)
if (st == "y"):
print("Total Employee Count : " , Employee.empCount)
if (st == "z"):
wantedId = input("Give the id : ")
Employees[wantedId].displayEmployee()
if (st == "q"):
exit()
if (st == "s"):
print("This module still under development")
if (st == "l"):
print("This module still under development.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment