So I have the y and e endings down, just need some help with the middle. Basically, I need to double the last letter before adding er if:
the last letter is b,d,g,l,m,n,p,r,s or t
and the second to last letter is not the same as the last letter.
def add(word):
wordlength = len(word)-1
if word[wordlength]=="y":
word=word.replace('y', 'i')
word=word +'er'
print(word)
elif word[wordlength] == "e":
word=word+'r'
elif word[wordlength] == [
Should I create a list of consonants and re.search through it?
Some help would be greatly appreciated!