Strings keep their original value when a method is called. Assign the result of strip(), lower(), or a slice to a name when you need the changed text.
raw = " SUN " word = raw.strip().lower() print(f"{word} ends in {word[-1]}") # sun ends in n