#!/usr/bin/env python3
# coding: utf8
'''
Created on October 31st, 2017
@author: Geetanjali
'''
def cumulative_sum(num_list):
"""
:param num_list: the list of numbers whose cumulative sum is to be found
:return num_list: the list passed as argument is returned with the cumulative sum of all the elements appended as the last element
"""
new_element = 0
for i in range(0, len(num_list)):
new_element = new_element+num_list[i]
num_list.append(new_element)
return(num_list)
if __name__ == '__main__':
num_list = []
print("Enter a list: (just enter a non-numeric character to stop)")
while(True):
user_input = input()
if(user_input.isdigit()):
num_list.append(int(user_input))
else:
break
print(cumulative_sum(num_list))