'''
Created on Sep 15, 2016

@author: Susan
'''
def modify(name):
    words = name.split()
    if len(words)== 1:
        return name
    if len(words)== 2:
        return words[1] + ", " + words[0] 
    middle = words[1:-2]    # not right, need to fix
    print "middle", middle
    # now need a for loop over this list words
    return name  # needs to be fixed


print modify("prince")
print modify("two words")
print modify("lots of words here")