From 973661fcbf389c8ecfe85b1f609ea94b63df1af1 Mon Sep 17 00:00:00 2001 From: lolabird Date: Sun, 19 Nov 2023 20:17:46 -0700 Subject: [PATCH] Get punctuation working with plurals --- thinkcspy/Chapter-12-Exercises/Problem5.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/thinkcspy/Chapter-12-Exercises/Problem5.py b/thinkcspy/Chapter-12-Exercises/Problem5.py index 9c08403..90d51b3 100644 --- a/thinkcspy/Chapter-12-Exercises/Problem5.py +++ b/thinkcspy/Chapter-12-Exercises/Problem5.py @@ -41,11 +41,11 @@ def translator(english): if word[lengthier] == 's' or word[lengthiest] == 's': englishList[i] = pirate[newWord] + 's' - if not word[lengthiest].isalpha(): - englishList[i] = pirate[newWord] + word[lengthiest] + if not word[lengthier].isalpha(): + englishList[i] = pirate[newWord] + 's' + word[lengthier] - elif not word[lengthiest].isalpha(): - englishList[i] = pirate[newWord] + word[lengthiest] + elif not word[lengthier].isalpha(): + englishList[i] = pirate[newWord] + word[lengthier] else: englishList[i] = pirate[newWord]