#!/usr/bin/python # strings for testing my_string1=" Red Hat Linux " my_string2=" CentOS" my_string3="Debian " my_string4="Ubuntu Linux" my_string_list = [my_string1, my_string2, my_string3, my_string4] ##-- Various Methods to Normalize Your Strings Prior to Comparison --## for string in my_string_list: # Original String print("Original string: " + string) # Convert to all lowercase print("String all lowercase: " + string.lower()) # Convert to all uppercase print("String all uppercase: " + string.upper()) # Strip all white spaces from the left print("Left strip white spaces: " + string.lstrip()) # Strip all white paces from the right print("Right strip white spaces: " + string.rstrip()) # Strip both left and right spaces print("Strip both left and right white spaces: " + string.strip())