mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-09-22 04:50:46 +02:00
17 lines
No EOL
442 B
Python
17 lines
No EOL
442 B
Python
def pluralize(word):
|
|
if word.endswith('y'):
|
|
return word[:-1] + 'ies'
|
|
elif word.endswith(('s', 'sh', 'ch', 'x', 'z')):
|
|
return word + 'es'
|
|
elif word.endswith(('f')):
|
|
return word[:-1] + 'ves'
|
|
else:
|
|
return word + 's'
|
|
|
|
def sort_list(list_to_sort):
|
|
if isinstance(list_to_sort, list):
|
|
list_to_sort = sorted(list_to_sort)
|
|
return list_to_sort
|
|
else:
|
|
return list_to_sort
|
|
|