Write a RoundRobin Iterator in python

Implement a robin robin iterator in Python which takes in a list of lists and has:
hasNext() to return boolean if there is a next element
next() to return/print the next element

The round robin iterator iterates irrespective of if every list is not the same size

# example
a = ['a1','a2','a3']
b = ['b1']
c = ['c1','c2','c3','c4']
round_robin([a,b,c])

round_robin.hasNext()
round_robin.next()
round_robin.hasNext()
round_robin.next()
round_robin.hasNext()
round_robin.next()
round_robin.hasNext()
round_robin.next()
round_robin.hasNext()
round_robin.next()
round_robin.hasNext()
round_robin.next()
round_robin.hasNext()
round_robin.next()
round_robin.hasNext()
round_robin.next()

# print example
['a1','b1','c1','a2','c2','a3','c3','c4']
Comments (1)