''' Purpose: demonstrate string acquisition (the getting of input) ''' # "Tell me what is on your mind: " is the prompt string # STYLE NOTE: we end prompts in colons and spaces for readability - python doesn't care but we do reply1 = input( "Tell me what is on your mind: " ) # python will wait for you to hit enter to continue the program # an input() statement without a prompt will just sit and wait for someone to hit enter # so don't ever do this! CS 1112 rules say that we always have prompts with our input() statements # what's happening at line 6: python allocates a space in memory for a string, as that's what is returned from input # it will display the prompt statement and wait for input followed by enter # once you hit enter, everything you typed (including spaces!) is grabbed and stored as a string in the variable reply1 # the colon is a human hint to a human user. it's inside the prompt string and python does not care # the variable to be assigned is ALWAYS on the left # target = value - calculate value and store it in a space named target print() # these print blank lines, since there's nothing in the parentheses # print() ends by moving the cursor for output to a new line print( "Hmmm ---", reply1 ) print() reply2 = input( "Why is that on your mind: " ) # again, python will wait for you to hit enter to continue print() print( "Oh? I wish we had more time to chat. So long." ) # hw/cw assignments with input() will have possible program runs with sample input that will catch many common issues # designing your own test cases is important and can catch other issues as well, as your code will be tested against # more inputs than what is shown # print() v. input() # print() will display to the console # input() is only used to get information, never solely to display - only used when you want input from the user