Created
May 15, 2018 01:03
-
-
Save AhmedZahid098/0298c7ddd93eb8c698b31b9626bccda2 to your computer and use it in GitHub Desktop.
This file contains 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 Worker: | |
def __init__(self, name, pay): | |
self.name = name | |
self.pay = pay | |
def firstName(self): | |
return self.name.split()[0] | |
def giveRaise(self, percent): | |
self.pay *= (1.0 + percent) | |
ahmed = Worker('Ahmed Zahid', 100000) | |
ali = Worker('Ali Zahid', 600000) | |
print(ahmed.firstName()) | |
print(ali.firstName()) | |
ali.giveRaise(.10) | |
print(ali.pay) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment