How to create a python class for an employee biodata?

Question : Create a python class for an employee biodata?

Answer :

Python Program

class Employee:
    def __init__(self,Name,Age,Gender,Height,Weight,Occupation,Salary):
        self.N=Name
        self.A=Age
        self.G= Gender
        self.H=Height
        self.W = Weight
        self.O = Occupation
        self.S=Salary
f1=Employee("Mr. Akshay Kumar",46,"M",150,65,"Actor",100000000)
print(f1.N,"\n",f1.A, "\n",f1.G, "\n",f1.H, "\n",f1.O, "\n",f1.S, "\n")

Output :

Mr. Akshay Kumar

46

M

150

Actor

100000000

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply