fork download
  1. # your code goes here
  2.  
  3. class Personnage:
  4.  
  5. static_property = 0
  6.  
  7. def __init__(self,name,last):
  8.  
  9. self.name = name
  10. self.last = last
  11. Personnage.static_property += 1
  12.  
  13. @property
  14. def name(self):
  15. retunr self.__name
  16.  
  17. @name.setter
  18. def name(self,name):
  19. self.__name = name
  20.  
  21. @property
  22. def last(self):
  23. return self.__last
  24.  
  25. @last.setter
  26. def last(self,last):
  27. self.__last = last
  28.  
  29. @staticmethod
  30. def times():
  31. return "it called {} times".format(Personnage.static_property)
  32.  
  33. def __str__(self):
  34. return "Hello from {} Class Your Username is {} and Your Lastname is {}".format(self.name,self.last)
  35.  
  36. class Child(Personnage):
  37.  
  38. def __init__(self,name,last,town,ager):
  39.  
  40. Personnage.__init__(self,name,last)
  41. self.town = town
  42. self.ager = ager
  43.  
  44.  
  45. @property
  46. def town(self):
  47. return self.__town
  48.  
  49. @town.setter
  50. def town(self,town):
  51. self.__town = town
  52.  
  53. @property
  54. def ager(self):
  55. return self.__ager
  56.  
  57. @ager.setter
  58. def ager(self,ager):
  59. self.__ager = ager
  60.  
  61. def __str__(self):
  62. super.__str__() + " and You're Living in {} and You are {} years old".format(self.town,self.ager)
  63.  
  64. def main():
  65.  
  66. person = Personnage("elomari","mohammed")
  67. print(person)
  68. main()
  69.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 125, in compile
    _optimize=optimize)
  File "<frozen importlib._bootstrap_external>", line 735, in source_to_code
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "./prog.py", line 15
    retunr self.__name
              ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.5/py_compile.py", line 129, in compile
    raise py_exc
py_compile.PyCompileError:   File "./prog.py", line 15
    retunr self.__name
              ^
SyntaxError: invalid syntax

stdout
Standard output is empty