how to remove part of string after certain character in python code example Example: remove after and before space python st = " a " strip(st) #Output : "a"