From 636ed9c9e1263e01987c7896aed59540dae32c1d 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:24:58 +0000 Subject: [PATCH 1/2] [Sync Iteration] python/isogram/1 --- solutions/python/isogram/1/isogram.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 solutions/python/isogram/1/isogram.py diff --git a/solutions/python/isogram/1/isogram.py b/solutions/python/isogram/1/isogram.py new file mode 100644 index 0000000..98b31c5 --- /dev/null +++ b/solutions/python/isogram/1/isogram.py @@ -0,0 +1,2 @@ +def is_isogram(string): + pass From 1183d5ea39f10879787ff6d53a9ee2f343293117 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:30:21 +0000 Subject: [PATCH 2/2] [Sync Iteration] python/isogram/2 --- solutions/python/isogram/2/isogram.py | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 solutions/python/isogram/2/isogram.py diff --git a/solutions/python/isogram/2/isogram.py b/solutions/python/isogram/2/isogram.py new file mode 100644 index 0000000..2964d8c --- /dev/null +++ b/solutions/python/isogram/2/isogram.py @@ -0,0 +1,35 @@ +""" +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 + """ + letters: list[str] = [char for char in string.lower() if char.isalpha()] + return len(letters) == set(letters)