193k views
5 votes
Whats the sum of all odd numbers between 1 and 1000

User Rakim
by
8.5k points

1 Answer

4 votes
Answer: 250000

x=1y=0
while(x<=999): y += x x += 2
print(y)
User Jacek Cz
by
7.9k points