Created
August 19, 2012 14:09
-
-
Save masnun/3395037 to your computer and use it in GitHub Desktop.
Pythonic Eid Greeting
This file contains hidden or 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
#!/usr/bin/env python | |
class Eid(object): | |
def __get__(self,instance,owner): | |
return "Eid-Ul-Fitr " | |
class Salutation(object): | |
def __get__(self,instance,owner): | |
return "Mubarak!" | |
class Celebration: | |
ocassion = Eid() | |
salutation = Salutation() | |
def greet(self): | |
print "Wishing you a pythonic " + self.ocassion + self.salutation | |
if __name__ == "__main__": | |
celebration = Celebration() | |
celebration.greet() |
Sarim always has something down the his forks!
github should have a like button :D
🐸 Gittu is the man! 💡
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://ideone.com/jZVZL Live Edition ;)