0

New to python and I'm trying to make a code to turn single nouns into plural, I'm not putting that much attention to irregular nouns. My problem is that my code goes thru only the first part, could someone help me? I'm on python 3.

last_char = input('Please enter a word: ')
replace_es = 'es'
replace_ies = 'ies'
replace_ves = 'ves'
replace_others = 's'

if last_char[:-3] == 'ch' or 'sh':
    last_char = last_char + replace_es
    print(last_char)

elif last_char[:-2] == 's' or 'x' or 'z':
    last_char = last_char + replace_es
    print(last_char)

elif last_char[:-3] == 'by' or 'cy' or 'dy' or 'fy' or 'gy' or 'hy' or 'jy' or 'ky' or 'ly' or 'my' or 'ny' or 'py' or 'qy' or 'ry' or 'sy' or 'ty' or 'vy' or 'wy' or 'xy' or 'zy':
    last_char = last_char + replace_ies
    print(last_char)

elif last_char[:-2] == 'f':
    last_char = last_char + replace_ves
    print(last_char)

elif last_char[:-3] == 'fe':
    last_char = last_char + replace_ves
    print(last_char)

else:
    last_char = last_char + replace_others
    print(last_char)

0 Answers0