Q:

Backtracking in a while loop (python 3.x)

I'm reasonably new to Python. I wanted to know if I could use an input and ask a question like 'are you sure?', and if the answer is no to go back to the original input. I've got this so far:
variable = input("Make a choice between a, b, c or d. ")
while variable not in ("a","b","c","d"):
    variable = input("Make a correct choice. ")

if variable == "a":
    do things
if variable == "b":
    do other things
etc etc

I want to ask, after they have typed in their choice, are you sure about your choice? If they say yes, that's fine, carry on, but if they say 'no' I want to be able to go to the same input without typing the whole thing out again. Is there any way to do that?   

A:

You could embed the bit that you want to repeat in a while True block that you break out of? For example:
while True
    answer = input("What is the correct answer, a, b, or c? ")
    check = input("Are you sure (y/n)? ")
    if check=="y" or check=="Y":
        break

