Loading lesson path
Concept visual
Start at both ends
Formula
Python has a set of built - in methods that you can use on strings.method returns the string in upper case: a = "Hello, World!"
print(a.upper())method returns the string in lower case: a = "Hello, World!"
print(a.lower())Formula
Whitespace is the space before and/or after the actual text, and very often you want to remove this space.method removes any whitespace from the beginning or the end: a = " Hello, World! "
print(a.strip()) # returns "Hello, World!"method replaces a string with another string: a = "Hello, World!"
print(a.replace("H", "J"))method returns a list where the text between the specified separator becomes the list items.
method splits the string into substrings if it finds instances of the separator: a = "Hello, World!"
print(a.split(",")) #
returns ['Hello', ' World!']Python Lists chapter.