'''
Created on Sep 19, 2017

@author: Susan
'''
def removePlurals(phrase):
    answer = ""
    alist = phrase.split()
    for word in alist:
        if word[-1] == "s":
            answer = word[:-1] + " "
        else:
            answer = word + " "
    return answer.strip()

def removePlurals2(phrase):
    answer = ""
    alist = phrase.split()
    for word in alist:
        if word[-1] == "s":
            answer = word[:-1] + " "
        else:
            answer = word + " "
        print "answer is", answer
    return answer.strip()

def removePlurals3(phrase):
    answer = ""
    alist = phrase.split()
    for word in alist:
        if word[-1] == "s":
            answer = answer + word[:-1] + " "
        else:
            answer += word + " "
            # answer = answer + word + " "
        #print "answer is", answer
    return answer.strip()

if __name__ == '__main__':
    print "removePlurals"
    print removePlurals("We always love the frogs and spiders")
    print removePlurals("This is the place for frogs and spiders")

    print
    print "removePlurals2"
    print removePlurals2("We always love the frogs and spiders")
    print removePlurals2("This is the place for frogs and spiders")

    print
    print "removePlurals3"
    print removePlurals3("We always love the frogs and spiders")
    print removePlurals3("This is the place for frogs and spiders")