【python】+循环

一、循环:range(len())

for i in range(len(configCodes))
        # 批量删除配置
        for i in range(len(configCodes)):
            param = {"configCode": configCodes[i]}
            param = json.dumps(param)
            # step2:若删除失败
            request = requests.post(url, param, headers=header)
            jsonRequest = json.loads(request.content)
            if (jsonRequest["success"] == False):
                print(request.content)
            else:
                print("删除成功:" + configCodes[i])

 

二、多种循环方式

https://blog.csdn.net/weixin_37887248/article/details/86472113

posted @ 2019-10-16 16:32  淡怀  阅读(192)  评论(0编辑  收藏  举报