Hey guys
Andrew here, with another problem.
My while loop is made so that it is on, or off, simple eh? That's what I thought, but it doesn't seem to be acting as I would expect it to!
The problem is, when I want it to loop, in testing it didn't loop, which is a problem!
This is my code:
print "HOW MANY VARIABLES WOULD YOU LIKE?"
print "2"
print "3"
print "4"
print "5"
print "6"
print "7"
print "8"
print "9"
print "10"
print "--------------------------------------------------------------------------------"
MainLoop = 1
while MainLoop == 1:
variables = raw_input (" ")
if variables == "2":
name1 = raw_input ("NAME YOUR FIRST VARIABLE ")
time.sleep(1)
name2 = raw_input ("NAME YOUR SECOMD VARIABLE ")
time.sleep(1)
print "--------------------------------------------------------------------------------"
NameInHat = raw_input ("PLEASE PRESS ENTER TO PICK YOUR RANDOM VARIABLE ")
loop = 1
while loop == 1:
randomg = random.randint(1, 2)
if randomg == 1:
print name1
elif randomg == 2:
print name2
end = raw_input ("WOULD YOU LIKE TO FINISH? ")
if end == "YES" or "yes" or "y" or "Y":
loop = 2
elif end == "no" or "NO" or "n" or "N":
print " "
print "THANK YOU USING MY APP."
menu = raw_input ("WOULD YOU LIKE TO GO BACK TO THE MENU? ")
if menu == "no" or "NO" or "n" or "N":
MainLoop = 2
exit
elif menu == "YES" or "yes" or "y" or "Y":
print " "
Hope this is fixable. And could someone also provide an explanation as to why it isn't working, and how they fixed it!