10/29/2018 while_sum.
py
1 # sum : 1 to 10(or any number)
2 total = 0
3 i = 1 # i = 2
4 while i <= 20:
5 total += i # total = total + i
6 i += 1
7 print(total)
8 # total = 0 + 1 + 2 + 3 + 4
https://www.dropbox.com/s/w2xdubg6tw8dkvb/while_sum.py?dl=0 1/1