Given a function process_list that takes a list of unique IDs and sends the list to an API endpoint for processing. The limit for the list is 100 elements at a time.
If I have a list that is more than 100 elements, how do I process the first 100, then the next 100, until I reach n?
my_list = [232, 231, 932, 233, ... n]
# first 100
process_list(my_list[:100])
def process_list(my_list):
url = 'https://api.example.com'
data = {'update_list': my_list}
headers = {'auth': auth}
r = requests.put(url, data=json.dumps(data), headers=headers)