Skip to content

Instantly share code, notes, and snippets.

@AhmedZahid098
Created May 15, 2018 01:03
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 AhmedZahid098/0298c7ddd93eb8c698b31b9626bccda2 to your computer and use it in GitHub Desktop.
Save AhmedZahid098/0298c7ddd93eb8c698b31b9626bccda2 to your computer and use it in GitHub Desktop.
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