[Solved] Need a Python program Singular to Plural [closed]


Just make it so that it appends “s” unless the word ends with “y” or some other exception:

def plural(word):
    wordlist = []
    for char in word:
        wordlist.append(char)
    if word[len(word)-1] == "y":
        wordlist[len(word)-1] = "ies"
    else:
        wordlist.append("s")
    word = ""
    for i in wordlist:
        word+=i
    return word
print(plural("STRING"))


solved Need a Python program Singular to Plural [closed]