Calculate sum using range in python

sum = 0
numbers = range(1,10)
for i in numbers:
   sum += i
print(sum)

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.