Hey guys, I'm new here, and I'm new to Python. So I've got a sample program:

a = raw_input("Enter some text: ")
while a != "quit":
    print a
    a = raw_input("Enter some text: ")
print "Are you sure? (y/n)"
b = raw_input()
if b == "y":
    exit

I was wondering what do I add at the end so that if b == "n" it will restart the program, or go back to the second line of code?
Any help appreciated.

You can put everything inside

while True:

loop, you may use break instead of exit then. Or you may move opposite of your exit condition as while condition.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.