I have a CSV file which I\'m reading in like below. I need to get the first word of all the strings. I know how to get first letter but I\'m not sure how I can get words.
You can use a list comprehension , and split() function :
>>> l=['diffuse systemic sclerosis', 'back', 'public on july 15 2008'] >>> [i.split()[0] for i in l] ['diffuse', 'back', 'public']