Guest User

Untitled

a guest
Dec 13th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. n = 4
  2. # initialize sum and counter i
  3. sum = 0
  4. i = 1
  5. while i <= n:
  6. sum = sum + i
  7. i = i+1 # update counter
  8. print("The sum is", sum)
Add Comment
Please, Sign In to add comment