i doing a proram where i will first ask the user to key in the datas they have, Lets 3, then i will on ly allow them to key in 3 datas.
after that , ithe 3 datas will be add together, giving the total sum automatically.
This is the program that i write:
total=0
aCounter=0
a=raw_input("in sert a:\t")
a=float(a)
while a!=-1:
total=total+a
aCounter=aCount er+1
a=raw_input("in sert a:\t")
a=float(a)
if aCounter!=0:
add=float(total )/aCounter
n=float(n)/aCounter
print"total X ia",add
if a==n:
break
but when i run , ii state there " break outside loop",. Can anyone tell me how to do?? thank you.
after that , ithe 3 datas will be add together, giving the total sum automatically.
This is the program that i write:
total=0
aCounter=0
a=raw_input("in sert a:\t")
a=float(a)
while a!=-1:
total=total+a
aCounter=aCount er+1
a=raw_input("in sert a:\t")
a=float(a)
if aCounter!=0:
add=float(total )/aCounter
n=float(n)/aCounter
print"total X ia",add
if a==n:
break
but when i run , ii state there " break outside loop",. Can anyone tell me how to do?? thank you.
Comment