''' Purpose: expand input processing capabilities by splitting an input string into its component words ''' # get input reply = input( 'What are your three favorite words: ' ) # reply is a single string # 'a b c' is still a single string, not 'a', 'b', 'c' print() # a_string.split() # reply.split() # split reply into a list of things (individual words) # split() is a string behavior function --> gives you list of things that make up that string # split based on spaces; gets rid of all spaces # determine individual words w1, w2, and w3 w1, w2, w3 = reply.split() # functions need () to run!! # if reply = 'you me us' --> gives you a list that has 'you', 'me', 'us' # each of those strings will be assigned to each variable on the left side # w1 = 'you', w2 = 'me', w3 = 'us' # if you input multiple integers, you need to split them into individual strings # then convert each into an integer one at a time # display results # each word on its own line print( w1 ) print( w2 ) print( w3 )