#Remove leading and trailing spaces S1 = ' Python rocks ' print(S1) print(S1.strip()) print(S1.lstrip()) print(S1.rstrip())