The itertools module in the standard library offers a number of useful tools for working with collections of elements through iterators.

The cycle() function in the  module creates an iterator that endlessly cycles through the elements of an iterable object.

cycle(iterable)
iterable Required. An iterable object(list, range, set, tuple, etc) whose elements are to be cycled. 

The function returns an iterator that yields the elements from the iterable until they are exhausted. It then starts all over again indefinitely.

from itertools import cycle

data = ['Python', 'Java', 'C++']

my_cycle = cycle(data)

print(next(my_cycle))
print(next(my_cycle))
print(next(my_cycle))
print(next(my_cycle))
print(next(my_cycle))
print(next(my_cycle))
print(next(my_cycle))