Skip to content

Instantly share code, notes, and snippets.

@Deep18-03
Created May 16, 2020 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Deep18-03/8518ad64da82e254f1cf684f388951f0 to your computer and use it in GitHub Desktop.
Save Deep18-03/8518ad64da82e254f1cf684f388951f0 to your computer and use it in GitHub Desktop.
class Employee:
no_of_leaves=5
def __init__(self,name,salary,role):
self.name=name
self.salary=salary
self.role=role
def printdetail(self):
return f"name is {self.name}.Salary is {self.salary}.Role is {self.role}"
class Player:
no_of_games=9
no_of_leaves = 6
def __init__(self,name,game):
self.name=name
self.game=game
def printdetail(self):
return f"name is {self.name}.Salary is {self.game}"
class bestProgrammer(Employee,Player):
language="python"
def print(self):
return f"name is {self.name}.Salary is {self.salary}.Role is {self.role},{self.language}"
mohan=bestProgrammer("Mohan",123,"student")
print(mohan.printdetail())
print(mohan.print())
print(mohan.no_of_leaves)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment