[Tutor] Program not accessing while loops

Aaron wildchild07770@yahoo.com
Mon, 30 Apr 2001 15:54:42 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C0D18D.DEF0F0A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi, I wrote this out last night on a different computer and I had the =
script running fine but now that I rewrote it doesn't seem to be =
accesing the second group of while loops, the main menu will load and =
keep running and asking for input, but it won't call on the loop.

#character managment program
totop =3D 1
while totop =3D=3D 1:
    print
    print "Main Menu"
    print "---------"
    print
    mainmenu =3D ["1 for to create a new character", "2 to manage an =
existing character", "3 to exit the program"]
    for x in mainmenu:
        print "Enter", x
    mainmen =3D raw_input(">")
    while mainmen =3D=3D 1:
        print "This function is under construction"
    while mainmen =3D=3D 2:
        print "This function is under construction"
    while mainmen =3D=3D 3:
        exit =3D raw_input("are you sure? ")
        if exit =3D=3D r"yes":
            totop =3D=3D 2
            break
        elif exit =3D=3D r"no":
            totop =3D=3D 1
            break
    while mainmen < 3:
        print "Invalid choice, choose again"
        for x in mainmenu:
            print "Enter", x
        mainmen =3D raw_input(">")

Thanks, aaron

------=_NextPart_000_0007_01C0D18D.DEF0F0A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.100" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi, I wrote this out last night on =
a&nbsp;different=20
computer&nbsp;and I had the script running fine but now that I rewrote =
it=20
doesn't seem to be accesing the second group of while loops, the main =
menu will=20
load and keep running and asking for input, but it won't call on the=20
loop.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>#character managment program<BR>totop =
=3D 1<BR>while=20
totop =3D=3D 1:<BR>&nbsp;&nbsp;&nbsp; print<BR>&nbsp;&nbsp;&nbsp; print =
"Main=20
Menu"<BR>&nbsp;&nbsp;&nbsp; print "---------"<BR>&nbsp;&nbsp;&nbsp;=20
print<BR>&nbsp;&nbsp;&nbsp; mainmenu =3D ["1 for to create a new =
character", "2 to=20
manage an existing character", "3 to exit the =
program"]<BR>&nbsp;&nbsp;&nbsp;=20
for x in mainmenu:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print =
"Enter",=20
x<BR>&nbsp;&nbsp;&nbsp; mainmen =3D =
raw_input("&gt;")<BR>&nbsp;&nbsp;&nbsp; while=20
mainmen =3D=3D 1:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print =
"This function=20
is under construction"<BR>&nbsp;&nbsp;&nbsp; while mainmen =3D=3D=20
2:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "This function is =
under=20
construction"<BR>&nbsp;&nbsp;&nbsp; while mainmen =3D=3D=20
3:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit =3D raw_input("are =
you sure?=20
")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if exit =3D=3D=20
r"yes":<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
totop =3D=3D =
2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
break<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elif exit =3D=3D=20
r"no":<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;=20
totop =3D=3D =
1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
break<BR>&nbsp;&nbsp;&nbsp; while mainmen &lt;=20
3:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "Invalid choice, =
choose=20
again"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for x in=20
mainmenu:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;=20
print "Enter", x<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mainmen =
=3D=20
raw_input("&gt;")</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks, =
aaron</FONT></DIV></BODY></HTML>

------=_NextPart_000_0007_01C0D18D.DEF0F0A0--