''' Purpose: continue string manipulation introduction ''' print() # operator + when given two string operands produces their concatenation; # i.e., a new string that is formed by running the two operands together print( '### operator + performs concatenation' ) a = 'fire' b = 'fighter' c = a + b # c = 'firefighter' no spaces because we didn't put it there print( 'a =', a ) print( 'b =', b ) print() print( 'a + b =', c ) print() # operator * when one of its operands is a string and the other is an integer, # produces a new string that is a repeated concatenation of string operand # indicated by the integer print( '### * operator produces repeated concatenation' ) m = '\tWahoo-Wah!\n' # m string here will include a tab in front of 'Wahoo-Wah' and include a new line n = 3 # \ is called an escape character. You must use it in '' to indicate a special character immeidiately after # '\t' = tabs character # '\n' = newline character # '\'' = ' after \ is a regular character and not the end of the string # '\\' = the second \ is a regular character and not a special \ # print( 'you can print a backslash like this \\' ) # we can use * between a string (m) and a number (n) to get n copies of the same string (m) # concatenated together mn = m * n nm = n * m print( 'm = ', m, 'read me' ) # m as it currently stands has a tab character in front of Wahoo-Wah and has a newline # newline starts a new line --> gives you that space between m =... and then n = 3 print( 'n = ', n ) print() print( 'm * n =', nm ) print( 'n * m =', nm )