From b1112e6dca5caf312af6e70643244071a809d690 Mon Sep 17 00:00:00 2001 From: "exercism-solutions-syncer[bot]" <211797793+exercism-solutions-syncer[bot]@users.noreply.github.com> Date: Wed, 3 Sep 2025 22:35:10 +0000 Subject: [PATCH 1/3] [Sync Iteration] python/isogram/3 --- solutions/python/isogram/3/isogram.py | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 solutions/python/isogram/3/isogram.py diff --git a/solutions/python/isogram/3/isogram.py b/solutions/python/isogram/3/isogram.py new file mode 100644 index 0000000..126157d --- /dev/null +++ b/solutions/python/isogram/3/isogram.py @@ -0,0 +1,39 @@ +""" +Isogram. + +Determine if a word or phrase is an isogram. + +An isogram (also known as a "non-pattern word") is a word or phrase +without a repeating letter, however spaces and hyphens are allowed +to appear multiple times. + +Examples of isograms: + +lumberjacks +background +downstream +six-year-old + +The word isograms, however, is not an isogram, because the s repeats. +""" + + +def is_isogram(string: str) -> bool: + """ + Determine if a word or phrase is an isogram. + + An isogram is a word or phrase without repeating letters. Spaces and hyphens + are allowed to appear multiple times, but alphabetic characters must be unique + (case-insensitive). + + :param string: The word or phrase to check + :type string: str + :returns: True if the string is an isogram, False otherwise + :rtype: bool + """ + # empty string + if not string: + return True + + letters: list[str] = [char for char in string.lower() if char.isalpha()] + return len(letters) == len(set(letters)) From 65141710eb44479786c07981d2c5afe113e67d5c Mon Sep 17 00:00:00 2001 From: Egor Kostan Date: Wed, 3 Sep 2025 15:40:59 -0700 Subject: [PATCH 2/3] Update isogram_test.py --- isogram/isogram_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/isogram/isogram_test.py b/isogram/isogram_test.py index c65984f..4b178bd 100644 --- a/isogram/isogram_test.py +++ b/isogram/isogram_test.py @@ -1,3 +1,5 @@ +# pylint: disable=C0114, C0115, C0116, R0904 + # These tests are auto-generated with test data from: # https://github.com/exercism/problem-specifications/tree/main/exercises/isogram/canonical-data.json # File last updated on 2023-07-19 From f1db96af1bcee8709329096d68b80aa57f1de706 Mon Sep 17 00:00:00 2001 From: Egor Kostan Date: Wed, 3 Sep 2025 15:42:06 -0700 Subject: [PATCH 3/3] Update isogram.py --- isogram/isogram.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/isogram/isogram.py b/isogram/isogram.py index 126157d..5774011 100644 --- a/isogram/isogram.py +++ b/isogram/isogram.py @@ -22,9 +22,9 @@ def is_isogram(string: str) -> bool: """ Determine if a word or phrase is an isogram. - An isogram is a word or phrase without repeating letters. Spaces and hyphens - are allowed to appear multiple times, but alphabetic characters must be unique - (case-insensitive). + An isogram is a word or phrase without repeating letters. Spaces and + hyphens are allowed to appear multiple times, but alphabetic + characters must be unique (case-insensitive). :param string: The word or phrase to check :type string: str