Here I have a list of 5500 elements , I want to split in to batches of 1000. You can use a list comprehension with slicing to split a list of URLs into batches of 1000. Here’s an example:
In this example, batches will be a list of lists, where each inner list contains a batch of up to 1000 URLs. The last batch may have fewer than 1000 URLs if the total number of URLs is not evenly divisible by the batch size.
You can then iterate over batches to process each batch of URLs:
Refer more on python here : Python