adding all input numbers

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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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))