Answer the question
In order to leave comments, you need to log in
How to write an algorithm that would collect the id of friends of my friends, etc.?
Interested in such an algorithm in depth in n.
deep = 0
id_1 = [id]
id_2 = []
while deep != 2:
for x in range(len(id_1)):
if api.users.get(user_ids=id_1[x])[0].get('deactivated', 0) == 0:
id_2.extend(api.friends.get(user_id=id_1[x]))
id_1 = id_2.copy()
id_2.clear()
deep += 1
TypeError: getresponse() got an unexpected keyword argument 'buffering'
ConnectionResetError: [WinError 10054] Удаленный хост принудительно разорвал существующее подключение
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, 'Удаленный хост принудительно разорвал существующее подключение', None, 10054, None))
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'Удаленный хост принудительно разорвал существующее подключение', None, 10054, None))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question