Answer to Question #101695 in Python for kylie

Question #101695
Write code using the range function to add up the series 99, 98, 97, ... 1 and print the resulting sum.
1
Expert's answer
2020-01-26T05:49:16-0500

s=0

for i in range(99, 0, -1):

s=s+i

print("s=",s)







Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Ann
28.04.20, 21:37

s=0 for i in range(99, 0, -1): s=s+i #this line needs to be indented to work print("s=",s)

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS