Very new to Python.
Trying to take inputs from stdin in the form of numbers ex. 416 2876 2864 8575 9784 and convert to int for sum of all using a loop.
Having a terrible time just converting to int for use in a loop. Would like to get a hint on the integer issue and then try to solve myself. Was trying to test my code to print the integers after conversion.
while (int(n) >= 1):
You probably don't want to use
sys.stdin directly. Use
line = raw_input("Enter some numbers: ") total = 0 for n in line.split(): total = total + int(n) print "The total is: %d" % total