0

I have a list of ids as

x=[821,462,354,411,591,226,17,8]

I want to create a function to take 3 at a time and print 3 until all are printed. How can I do it ? I did like this but couldnt get the result

def split(a, n):
    k, m = divmod(len(a), n)
    return (a[i*k+min(i, m):(i+1)*k+min(i+1, m)] for i in range(n))

def print3atatime():
    y = list(split(range(len(x)),3))
OneCricketeer
  • 151,199
  • 17
  • 111
  • 216
ZZZSharePoint
  • 981
  • 5
  • 19

0 Answers0