''' Purpose(s): String chrestomathics Motivate the need for looping ''' ADAGE = "Love is all you need" # prompt and get from user the number of occurrences to be printed reply = input( "Enter number of lines to be printed: " ) n = int( reply ) # print the n occurrences of the string of interest combo = (ADAGE + '\n') * n # ADAGE WITH THE NEWLINE CHARACTER n times # \n is a character! and to denote that we want the newline CHARACTER # we need the quotation marks! # We can't do + unless we have strings and characters(which make # up strings). # '\n' is an escape character! It's just like 'a' or 'b' or 'c' # it's just like another letter/character but it's a special # character that just causes a new line. # variable = value # functions have () to call functions but you can also use # parentheses in general too # so like .split() is a function not a variable but combo is a variable # since it's an identifier being assigned a value new_line = '\n' s = ( ADAGE + new_line ) * n # we just use parentheses here # to show that they're together. print( combo )