i have a program like this:
def facilities():
total_rate=vrates=funrate=rates5=0
def food():
#files are used
rates5=0
# calculate the rate and store the total rate in rates5
def recreation():
#files are used
funrate=0
# calculate the rate and store the total rate in funrate
def transport():
#files are used
vrates=0
# calculate the rate and store the total rate in vrates
food()
recreation()
transport()
total_rate=rates5+vrates+funrate
print"The total amount=",total_rate
facilities()
at the end i want to calculate the sum of funrate,vrates and rates5.eg: funrate=100,vrates=200,rates5=300,then total_rate=600,but when i run the program, it comes like The total amount =0. either nothing comes or total_rate=0 comes. is there anything wrong with the declaration??
actually the real program is very long so i have shortened it to get the main idea. i have nested functions as that ia part of the program. please help!