adding all input numbers

Solutions on MaxInterview for adding all input numbers by the best coders in the world

showing results for - "adding all input numbers"
Timothée
24 Oct 2016
1# try block to handle the exception
2try:
3    my_list = []
4
5    while True:
6        my_list.append(int(input()))
7
8# if the input is not-integer, just print the list
9except:
10    print('Please Enter A Number')
11
12print(sum(my_list))