Skip to content

Instantly share code, notes, and snippets.

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 StephenFordham/2e6bb5c197b50a8ec445d62c20aa40da to your computer and use it in GitHub Desktop.
Save StephenFordham/2e6bb5c197b50a8ec445d62c20aa40da to your computer and use it in GitHub Desktop.
Instantiating an instance of the Employees class
class Employees(object):
def __init__(self, name, age, location):
self._name = name
self._age = age
self._location = location
e1 = Employees('stephen', 30, 'Bournemouth')
for key, value in e1.__dict__.items():
print('{}: {}'.format(key, value))
# Console output:
_name: stephen
_age: 30
_location: Bournemouth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment