View Single Post
  #2 (permalink)  
Old 06-10-2007, 05:26 PM
Paul P
Posts: n/a
sum = 0
for x in range(50,0,-1):
<tab>print 'iteration %s' % (x)
<tab>num = raw_input('Number please? ')
<tab>sum += int(num)

print 'Your sum is ':str(sum)

notes:
range(50,0,-1) will count down (you said count down)
sum += int(num) is the same as sum = sum + int(num), which accumulates your total sum.
I had to put <tab> in the code since Yahoo strips spaces at the start of lines.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!