Попытался объяснить как можно подробнее) есть функция: def func(): xclass = [] while True: result = requests.get('https://market.csgo.com/api/v2/items?key=xxxxxxxxxxxxxxxxxxxx').json() if result['success'] == True: if result['items'] != 'null': m = len(result['items']) for o in range(m): classid = result['items'][o]['classid'] xclass.append(classid) for x in range(m): itemid = result['items'][x]['item_id'] hashname = result['items'][x]['market_hash_name'] rewss = requests.get('https://market.csgo.com/api/v2/search-item-by-hash-name?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxx&hash_name=' + hashname).json() if result['items'][x]['position'] != 1: if result['items'][x]['position'] != 0: if rewss['data'] != []: k = len(rewss['data']) for j in range(k): firstprice = min(rewss['data'], key=lambda x: x['price'])['price'] cla = min(rewss['data'], key=lambda x: x['price'])['class'] newprais = float(firstprice) - 1.0 if hashname == rewss['data'][j]['market_hash_name']: duplicates = [int(k) for k, v in Counter(xclass).items() if v > 1] if cla not in duplicates: newprice1 = str(newprais) currency = result['items'][x]['currency'] r = requests.get('https://market.csgo.com/api/v2/set-price?key=xxxxxxxxxxxxxxxxxxxxx&item_id=' + itemid + '&price=' + newprice1 + '&cur=' + currency + '&') func() func() Код def func(): xclass = [] while True: result = requests.get('https://market.csgo.com/api/v2/items?key=xxxxxxxxxxxxxxxxxxxx').json() if result['success'] == True: if result['items'] != 'null': m = len(result['items']) for o in range(m): classid = result['items'][o]['classid'] xclass.append(classid) for x in range(m): itemid = result['items'][x]['item_id'] hashname = result['items'][x]['market_hash_name'] rewss = requests.get('https://market.csgo.com/api/v2/search-item-by-hash-name?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxx&hash_name=' + hashname).json() if result['items'][x]['position'] != 1: if result['items'][x]['position'] != 0: if rewss['data'] != []: k = len(rewss['data']) for j in range(k): firstprice = min(rewss['data'], key=lambda x: x['price'])['price'] cla = min(rewss['data'], key=lambda x: x['price'])['class'] newprais = float(firstprice) - 1.0 if hashname == rewss['data'][j]['market_hash_name']: duplicates = [int(k) for k, v in Counter(xclass).items() if v > 1] if cla not in duplicates: newprice1 = str(newprais) currency = result['items'][x]['currency'] r = requests.get('https://market.csgo.com/api/v2/set-price?key=xxxxxxxxxxxxxxxxxxxxx&item_id=' + itemid + '&price=' + newprice1 + '&cur=' + currency + '&') func() func() Скрипт анализирует цены и если моя позиция цены не равна 0 или 1 - меняет ее на цену,которая ниже минимальной на копейку.Проблема в том,что после последнего реквеста скрипт стартует заново.я пробовал убирать рекурсию(func()) тогда он застывает в последнем цикле.Я хочу чтобы он сначала проанализировал,потом менял и проанализированные элементы отсекал,а потом начинал все заново.Помагити