mralasic

for_petlja

Mar 26th, 2022 (edited)
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. amount = int(input("How many numbers would you like to add? "))
  2.  
  3. sum = 0
  4.  
  5. for i in range(1, amount + 1):
  6. print(sum)
  7. number = int(input("Enter number " + str(i) + ".: "))
  8.  
  9. sum = sum + number
  10.  
  11.  
  12. print("Sum of given numbers is " + str(sum))
  13.  
Add Comment
Please, Sign In to add comment