Basically I want something that was asked in All combinations of a list of lists,
but using ONLY while
or/and for
loops. In the other words, without the use of itertools
nor recursion.
I know many similar questions have been asked before, but unfortunately I could not find a desired answer. I have looked for some solutions which make use of both loops and recursions, but when I attempted to translate them into only loops, I found out it did not work for me. I have thought of putting for
loop inside a while
loop but then it works differently than using recursion, because the entire for
loop finishes before another while
loop starts.
I have stuck for hours, any help/hint is greatly appreciated. I am using Python 3 though!