class SomeClass(): def __init__(self): self.val=1 def do_some_check(self): return self.some_check(self.val) def some_check(self,val): # another static method - I did this so I didn't have to add 'self' to the args def times_negative_one(val): return val * -1 # another static method def if_positive(val): if val>0: return True else: return False return if_positive(times_negative_one(val)) someclass = SomeClass() print(someclass.val) print(someclass.do_some_check())
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