this does what i want, though i don't like the inner while loop having
to be there
def get_pct():
while True:
pct_list=[['cash', 0], ['bond', 0], ['blue', 0], ['tech', 0],
['dev',
0]]
total=0
for i in range(len(pct_list)):
while True:
pct_list[i][1]=raw_input('Please enter the
percentage value for %s:
' %pct_list[i][0])
if pct_list[i][1].isdigit() == False:
print "You've messed up, do it again..."
else:
total+=int(pct_list[i][1])
break
if total == 100:
return pct_list
break
else:
print "You've messed up, do it again..."
gosh, a lot of work to get some input. i must be missing something,
though this is a lot better than what i had before...
--
http://mail.python.org/mailman/listinfo/python-list