Skip to content

Instantly share code, notes, and snippets.

@ChaitanyaBaweja
Last active December 22, 2018 15:50
Show Gist options
  • Save ChaitanyaBaweja/ccf5df8beceffcb9f2db571e566cc9c3 to your computer and use it in GitHub Desktop.
Save ChaitanyaBaweja/ccf5df8beceffcb9f2db571e566cc9c3 to your computer and use it in GitHub Desktop.
A class that whenever called, prints whatever it stores.
class Printer:
def __init__(self, s):
self.string = s
def __call__(self):
print(self.string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment