''' 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 # set up the accumulator to prepare for adding elements # we want to capture the integers that we're producing in the for loop in a list, so we initialize numbers to... numbers = [] # start this off as an empty list # GOTCHA: numbers = int( nbr_strings ) this will NEVER work, you have to loop through # int() is a function that was never taught what to do with a list print( numbers ) # process the strings of nbr_strings one-by-one for ns in nbr_strings : # process the current numeric string # get numeric equivalent of ns nbr = int( ns ) # add equivalent to list of numbers numbers.append( nbr ) # print the updated list of numbers print( 'numbers:', numbers )