Last active
December 22, 2018 15:50
-
-
Save ChaitanyaBaweja/ccf5df8beceffcb9f2db571e566cc9c3 to your computer and use it in GitHub Desktop.
A class that whenever called, prints whatever it stores.
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 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