# Ryan NH pythonic would be this: class Humanist: def __init__(self, causes): self.causes = causes self.cares_about() def cares_about(self): print("\n") print("As a %s, you are care about:" % type(self).__name__) for issue in self.causes: print(issue) class Feminist(Humanist): def __init__(self, causes=["Feminism"]): super(Feminist, self).__init__(causes) self.causes = causes def what_people_think_you_care_about(): whatyousayyouare = input("Are you a feminist or humanist?").lower() if whatyousayyouare == "feminist": feminist = Feminist(["Feminist"]) return feminist elif whatyousayyouare == "humanist": humanist = Humanist(["All humans, regardless of Gender, Age, Cultural Identity or any other identifing trait",]) return humanist what_people_think_you_care_about()
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