import re, string, sys greeting = sys.argv[1] addressee = sys.argv[2] punctuation = sys.argv[3] class Felicitations(object): def __init__(self): self.felicitations = [ ] def addon(self, word): self.felicitations.append(word) def printme(self): greeting = string.join(self.felicitations[0:], "") print greeting def prints(string): string.printme() return def hello(i): string = "hell" + i return string def caps(word): value = string.capitalize(word) return value def main(): salut = Felicitations() if greeting != "Hello": cap_greeting = caps(greeting) else: cap_greeting = greeting salut.addon(cap_greeting) salut.addon(", ") cap_addressee = caps(addressee) lastpart = cap_addressee + punctuation salut.addon(lastpart) prints(salut) if __name__ == '__main__': main()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question