Skip to content

Instantly share code, notes, and snippets.

@dmitryTsatsarin
Created March 1, 2017 20:09
Show Gist options
  • Save dmitryTsatsarin/b2eb757bf064cebc24c23ff44b0ee67a to your computer and use it in GitHub Desktop.
Save dmitryTsatsarin/b2eb757bf064cebc24c23ff44b0ee67a to your computer and use it in GitHub Desktop.
class Employee:
def __init__(self, name, salary = 0):
self.name = name
self.salary = salary
def giveRaise(self, percent):
self.salary = self.salary + (self.salary * percent)
def work(self):
print(self.name, "I work")
def print_class(self):
return print("Class", type(self).__name__)
def __repr__(self):
return "name is: %s, salary: %s" % (self.name, self.salary)
bob = Employee('teste', 50)
print (bob)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment