469,366 Members | 2,243 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

Adding up a list

if we allow user to key in all the datas that they have, and we will help them sum up all, how to do?? below are program i do but it did.t work.

run=0
while run<>999:

#insert number of datas you have
n=raw_input("insert n:")
n=int(n)
x=int(n)

for x in range (1,n+1):
if x == n+2:
break

print"insert value of a:\n"

a=raw_input("insert a:\t")
a=float(a)

# X= total value of a
print"\nX=total value of a"
def add(x) : return a+a
x=int(a+a)
print"X=%d+%d+%d=" % (a,a),a+a


can anyone help me?? thank you
Sep 22 '06 #1
0 1086

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Andrew Ward | last post: by
34 posts views Thread by Adam Hartshorne | last post: by
26 posts views Thread by Simon Jefferies | last post: by
9 posts views Thread by Kadett | last post: by
4 posts views Thread by thoseion | last post: by
3 posts views Thread by Rob Meade | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.