Hello is it possible to avoid duplicates in a yield generator? for example
def foo():
for i in (1,1,1,2,3,4,5):
#check if "i" have not been "yielded" yet?
yield i
gen = foo()
numbers = list(gen)
print(numbers)
>>>[1,2,3,4,5]
numbers = list(gen) is cheating, the goal is to do it within the function