txt = " test " txt.strip() #Output: "test" txt.lstrip() #Output: "test " txt.rstrip() #Output: " test"