[python] Iterating through a string word by word