i am trying to teach myself python using this book called, core python programing by wesley chung. one of the exersises in this book says make a text based menu application that uses more than one of the programs you made already.When i made the application one of my code blocks does not work for some reason and the other one with similar code does. please help me fix the problem and explain what i am doing wrong.
#declaring var that controls program
a=0
#menu funtion
def menu():
print "\nmenu"
print "\n1=type numbers"
print "\n2=add 2 numbers"
print "\n3=quit"
return()
#loop that should repeat menu until a number that isnt 1 or 2 is pressed
while a==0:
menu()
a=int(raw_input("choose a menu number"))
# if 1 is pressed then this program prompts a
#a user for a number between 1 and 100
if a==1:
x=0
number=int(raw_input("type a number between 1 and 100 "))
while x==0:
if number<100 and number>0:
print "good job"
x+=1
# this should restart the loop but it doesnt
elif x==1:
a=0
#this should ask for another number if the
#number pressed isnt between 1 and 100
#but it just leaves a blank space
elif number>100 and number<0:
number=int(raw_input("again"))
#from what i know this code works
if a==2:
x=0
number=int(raw_input("what do u wanna add"))
while x==0:
number2=int(raw_input("number 2 please"))
number3=number+number2
print number3
#This does restart the loop
x+=1
if x==1:
a=0