471,825 Members | 957 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,825 software developers and data experts.

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 1128

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
reply views Thread by YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.