"CSUIDL PROGRAMMEr" <syedamjad_a at yahoo.com> writes: > ['amjad\n', 'kiki\n', 'jijiji\n'] > I am trying to get rid of '\n' after each name. > to get list as > ['amjad','kiki','jijiji'] > > But list does not have a strip function as string does have. > > is there any solutions a = ['amjad\n', 'kiki\n', 'jijiji\n'] b = [x.strip() for x in a] print b