''' Purpose: demonstrate the end optional parameter for print() ''' import time NBR_SECONDS_TO_PAUSE = 2.5 print( 'Wa-Hoo-Wa' ) print( 'Rah-Rah-Rah' ) print() time.sleep( NBR_SECONDS_TO_PAUSE ) print( 'Wa-Hoo-Wa', end='!!!' ) print( 'Rah-Rah-Rah' ) print() time.sleep( NBR_SECONDS_TO_PAUSE ) print( 'Wa-Hoo-Wa', end=' !!! ' ) print( 'Rah-Rah-Rah' ) print() time.sleep( NBR_SECONDS_TO_PAUSE ) # ch is the loop variable and it assumes the value # of each smaller part of the larger sequence # so it's going to be each character one by one in our string! # ch just says heres my sequence!!! let me break it up rq and be # each smaller part of it one by one! for ch in 'tattarrattat' : print( ch, end='-' ) # print(ch, '-') prints on separate lines! print() print() time.sleep( NBR_SECONDS_TO_PAUSE ) for ch in 'saippuakivikauppias' : print( ch, end='' ) # end is an empty string so it # will print each character right after the previous one on the # same line print() print() # Reminder that print() is printing a blank line # PRINT SUMMARIES SO FAR # You can print whatever you want. # print() prints a blank line # print(...) prints what's inside the parentheses on a new line. # print(..., end='..') followed by another print statement # will print the first print statement and the second print # statement will pick up where the last one left off on the # same line and put whatever the second thing to print is # at the end of what was printed first and what was in the end='...' # INPUT IS NOT THE SAME THING AS PRINT. # print('hi',end='no') # print('hello' # CONSOLE: # hinohello