Trim Function In Python With Parameters