fork download
  1. Class Chats:
  2. def __init__(self):
  3. self.vk_chats = []
  4. self.tg_chats = []
  5.  
  6. def add_vk_chat(self, vk_chat_id):
  7. self.vk_chats.append(vk_chat_id)
  8.  
  9. def add_tg_chat(self, tg_chat_id):
  10. self.tg_chats.append(tg_chat_id)
  11.  
  12. def remove_vk_chat(self, vk_chat_id):
  13. self.vk_chats.remove(vk_chat_id)
  14.  
  15. def remove_tg_chat(self, tg_chat_id):
  16. self.tg_chats.remove(tg_chat_id)
  17.  
  18. def contains(self, chat_id):
  19. return chat_id in self.tg_chats or chat_id in self.vk_chats
  20.  
  21. def __len__(self):
  22. return len(self.tg_chats) + len(self.vk_chats)
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.7/py_compile.py", line 143, in compile
    _optimize=optimize)
  File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "./prog.py", line 1
    Class Chats:
              ^
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.7/py_compile.py", line 147, in compile
    raise py_exc
py_compile.PyCompileError:   File "./prog.py", line 1
    Class Chats:
              ^
SyntaxError: invalid syntax

stdout
Standard output is empty