So I am working on a how to be able to print out 50 values from a list each time, meaning if a list contains a length of 120 values, it should print out first 50, then the second 50 and then the rest 20 in that case but the 120 would be a value of X meaning it could be changing all the time:
so what I have created so far is basically just a simple list
listTest = [1233,12412,12412,34653,78556,23523,1231231,345353,4574574,234524523,24124,34534534,4576445,23523523]
for x in listTest:
print(x)
data = {
"recipients": #List of first 50 then it should loop and take the second 50,
# then loop again through this request and so on,
"originator": "testing",
}
response = requests.post("https://test.com/messages", json=data)
which I just made a simple loop through the list but I have no idea on how to make it work that it should print first 50 values in a list, then the second 50 in a list, then the third 50 in a list etc etc until there is no more values in the list.
So it would be like etc:
print
> list of first [50 values]
> list of second [50 values]
> list of third [50 values]
> list of fourth [24 values]
How can I be able to do that?