fork(2) download
  1. # your code goes here
  2. class Test:
  3.  
  4. def mamku(self):
  5. return "mamku ebal"
  6.  
  7. def call(self, method):
  8. if hasattr(self, method):
  9. return self.method()
  10.  
  11. test = Test()
  12. print test.call("mamku")
Runtime error #stdin #stdout #stderr 0.01s 7732KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 12, in <module>
  File "prog.py", line 9, in call
AttributeError: Test instance has no attribute 'method'