python oops part 2

 input....

class Employee:
no_of_leaves=8
def printdetails(self):
return f" {self.name} is my name , {self.role} is my role and {self.salary} is my salary"


arihant=Employee()
vaibhav=Employee()

arihant.name= "ARIHANT"
arihant.salary=56947
arihant.role="coder"

vaibhav.name="VAIBHAV"
vaibhav.salary=65789
vaibhav.role="hacker"

print(arihant.printdetails())
print(vaibhav.printdetails())
 output...


 ARIHANT is my name , coder is my role  and  56947 is my salary
VAIBHAV is my name , hacker is my role and 65789 is my salary


ARIHANT JAIN

i am arihant jain and i am a student

Post a Comment (0)
Previous Post Next Post