Help with loop


#1

Hi,
I am trying to create a loop with in a loop.
The idea is to present a raw_input, if the input is wrong then loop back to the beginning until you get it right. I am trying to do this kind of loop twice with in one block but cant get it to work. Just for this example, the options of blank input or no/n will loop you back like written:

print "Hello! Welcome to the Trivia "
while True:
begin = raw_input("Would you like to begin?: ")
if begin == “”:
print “You must write something valid. Your name cannot be blank and must consist of letters only. Please try again:”
continue
while True:
if begin.lower() == “no” or “n”:
print “no or n is not accepted:”
continue
break
else:
print “Good choice”
name = raw_input ("Please insert your name: ")

Thanks


#2

what is the use of the continue keyword here? Continue is useful if you want to do nothing:

if True:
   continue

if you already have a print statement or anything else, a continue keyword becomes redundant.

Why would you use nested loops? Two separate loops after each other sounds like a better idea.