I am wondering, for education purposes, whether it's possible to rewrite all for loops in python as while loops. Theoretically, if and while is the minimum set of flow controls.
Searching around SO shows this question about range based for loops Converting for loops to while loops in python, which is obviously doable as the starting and ending indices are exposed. What about other forms of for loops? For example, what about looping through a list in its various forms?
for loop with a two-tuple as its iteratoras in the second link provided. Also, performance difference between iterators/generators etc. is not a concern for me as I am interested only in the equivalence.