-
-
Save dmitryTsatsarin/b2eb757bf064cebc24c23ff44b0ee67a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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