python split space or tab

Solutions on MaxInterview for python split space or tab by the best coders in the world

showing results for - "python split space or tab"
Juan Esteban
31 Jun 2019
1>>> teststr = "a   v w   ef sdv   \n   wef"
2>>> print teststr
3a   v w   ef sdv   
4   wef
5>>> teststr.split()
6['a', 'v', 'w', 'ef', 'sdv', 'wef']
7>>> teststr.split(" ")
8['a', '', '', 'v', 'w', '', '', 'ef', 'sdv', '', '', '\n', '', '', 'wef']
9