I am using Python 3.3.2 on a windows 7 32bit machine.
I am trying the following syntax:
def make_from(inputString):
if inputString.endswith('y'):
fixed = inputString[:-1] + 'ies'
if inputString.endswith(('o', 'ch', 's', 'sh', 'x', 'z')):
fixed = inputString[:] + 'es'
else:
fixed = inputString + 's'
return fixed
The first IF condition does not seem to be taking effect .. the others work for example if I type make_from('happy')
it returns 'happys'
, but if it type make_from('brush')
it returns 'brushes'
.
I guess I am missing something.. any idea whats going on here.