I have the following code:
shape = input("Please enter your choice of shape? ")
nthTime = ["second","third","fourth","fifth","sixth"]
while shape.lower() not in ["octagon","heptagon","hexagon"] :
print("Please select a shape from the list!")
shape = input("Pick a shape, for the " + nthTime + " time! ")
How can I achieve the outcome, that Python will iterate over the list 'nthTime', each time it passes through the `while-loop?
I could use a nested for-loop but of course this would run the whole list, which is not my aim.
Therefore, I conclude that I would need to use a nested while-loop; however I cannot figure out the exact syntax.
I'm hoping this will be a useful question for others also in the future.