Weird behaviour of a generator function while converting it to a list
Weird behaviour of a generator function while converting it to a list Question: I am trying to get every state of a list while it is being sorted for a visualization. So with bubbleSort algorithm i made a generator function : def bubbleSort(arr): n = len(arr) yield arr # yielding original state for i in …