""" Purpose: demonstrate some string methods. The string of interest comes from the NY Times. """ # Set string of interest s = "When an Eel Climbs a Ramp to Eat Squid From a Clamp, That's a Moray" # Get different capitalization versions v1 = s.lower() # Get copy with letters in lower case v2 = s.upper() # Get copy with letters in upper case v3 = s.capitalize() # Get copy with first character upper case, rest # lower case # none of these methods change the string s, so we have to assign the output to a target # that is because strings are immutable, they cannot be changed in methods # we need parentheses to tell python that we want to start up a function or a method # even if there's nothing in the parentheses, they are 100% necessary # people do not listen to your requests when you ask for input(), so you can fix it for them using methods # Print results print( "s:", s ) print() print( "s.lower():", v1 ) print( "s.upper():", v2 ) print( "s.capitalize():", v3 )