Advertisement
simeonshopov

sum numbers from 0 to n loop

Sep 25th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.11 KB | None | 0 0
  1. n = int(input())
  2. sum = 0
  3.  
  4. for i in range(0, n):
  5.   num = int(input())
  6.   sum +=num
  7. print(f"sum = {sum}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement