''' Purpose: convert an input list of integers into an integer list ''' # get input reply = input( 'Enter integers: ' ) print() # split reply into list of numeric strings nbr_strings = reply.split() # see what we got print( 'nbr_strings:', nbr_strings ) print() # convert numeric text into list of numbers # begin with setting up the accumulator numbers = [] # initialize holder to prepare for adding elements # process the strings of nbr_strings one-by-one for ns in nbr_strings : # process the current numeric string print( 'Loop variable:', "'" + ns + "'" ) nbr = int( ns ) # get numeric equivalent of ns print( 'Loop variable numeric equivalent:', nbr ) numbers.append( nbr ) # add equivalent to list of numbers print( 'Numbers (accumulator) so far:', numbers ) print( 'numbers:', numbers ) # print the updated list of numbers