From 9fb456166e194b19bad7697a172f9231aeddd00c 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 21:38:45 +0000 Subject: [PATCH 1/8] [Sync Iteration] python/pangram/1 --- solutions/python/pangram/1/pangram.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 solutions/python/pangram/1/pangram.py diff --git a/solutions/python/pangram/1/pangram.py b/solutions/python/pangram/1/pangram.py new file mode 100644 index 0000000..5377191 --- /dev/null +++ b/solutions/python/pangram/1/pangram.py @@ -0,0 +1,2 @@ +def is_pangram(sentence): + pass From f5ec96ead1aa72e834ca64dfcdcac8b5680ca672 Mon Sep 17 00:00:00 2001 From: Egor Kostan Date: Wed, 3 Sep 2025 14:44:12 -0700 Subject: [PATCH 2/8] Update pangram_test.py --- pangram/pangram_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pangram/pangram_test.py b/pangram/pangram_test.py index 09e303d..83740a6 100644 --- a/pangram/pangram_test.py +++ b/pangram/pangram_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/pangram/canonical-data.json # File last updated on 2023-07-19 From 7899a283e9cc788397fa7b24fc5fe8ff369902ee Mon Sep 17 00:00:00 2001 From: Egor Kostan Date: Wed, 3 Sep 2025 14:54:01 -0700 Subject: [PATCH 3/8] Update pangram.py --- pangram/pangram.py | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/pangram/pangram.py b/pangram/pangram.py index 5377191..cfb47d9 100644 --- a/pangram/pangram.py +++ b/pangram/pangram.py @@ -1,2 +1,27 @@ -def is_pangram(sentence): - pass +""" +Pangram. + +You work for a company that sells fonts through their website. They'd like to show a +different sentence each time someone views a font on their website. To give a +comprehensive sense of the font, the random sentences should use all the letters +in the English alphabet. + +They're running a competition to get suggestions for sentences that they can use. +You're in charge of checking the submissions to see if they are valid. +""" +import string + +letters: str = string.ascii_lowercase + + +def is_pangram(sentence: str) -> bool: + """ + Verify that the random sentences uses all the letters in the English alphabet. + + :param sentence: The sentence to check for pangram validity + :type sentence: str + :return: True if the sentence contains all 26 letters of the English alphabet, False otherwise + :rtype: bool + """ + sentence = sentence.lower() + return all(char in letters for char in sentence if char.isalpha()) From 2f62238ef10a3b7d66278965e805eb822f4fb710 Mon Sep 17 00:00:00 2001 From: Egor Kostan Date: Wed, 3 Sep 2025 14:56:58 -0700 Subject: [PATCH 4/8] Update pangram.py --- pangram/pangram.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pangram/pangram.py b/pangram/pangram.py index cfb47d9..e5e8164 100644 --- a/pangram/pangram.py +++ b/pangram/pangram.py @@ -23,5 +23,6 @@ def is_pangram(sentence: str) -> bool: :return: True if the sentence contains all 26 letters of the English alphabet, False otherwise :rtype: bool """ - sentence = sentence.lower() - return all(char in letters for char in sentence if char.isalpha()) + # Convert sentence to lowercase and extract unique alphabetic characters + unique_letters: set = set( char for char in sentence.lower() if char.isalpha()) + return all(char in letters for char in unique_letters) From 210c15643d6ba7c35f0e93f5a453731695e95550 Mon Sep 17 00:00:00 2001 From: Egor Kostan Date: Wed, 3 Sep 2025 15:02:26 -0700 Subject: [PATCH 5/8] Update pangram.py --- pangram/pangram.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pangram/pangram.py b/pangram/pangram.py index e5e8164..754cfe2 100644 --- a/pangram/pangram.py +++ b/pangram/pangram.py @@ -23,6 +23,10 @@ def is_pangram(sentence: str) -> bool: :return: True if the sentence contains all 26 letters of the English alphabet, False otherwise :rtype: bool """ + # Empty string + if not sentence: + return False + # Convert sentence to lowercase and extract unique alphabetic characters unique_letters: set = set( char for char in sentence.lower() if char.isalpha()) - return all(char in letters for char in unique_letters) + return len(unique_letters) == 26 From dd4730a322f3c0f0a4e277bbb07d3f8c917dde10 Mon Sep 17 00:00:00 2001 From: Egor Kostan Date: Wed, 3 Sep 2025 15:04:05 -0700 Subject: [PATCH 6/8] Update pangram.py --- pangram/pangram.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pangram/pangram.py b/pangram/pangram.py index 754cfe2..ee388f4 100644 --- a/pangram/pangram.py +++ b/pangram/pangram.py @@ -9,6 +9,7 @@ They're running a competition to get suggestions for sentences that they can use. You're in charge of checking the submissions to see if they are valid. """ + import string letters: str = string.ascii_lowercase @@ -28,5 +29,7 @@ def is_pangram(sentence: str) -> bool: return False # Convert sentence to lowercase and extract unique alphabetic characters - unique_letters: set = set( char for char in sentence.lower() if char.isalpha()) + unique_letters: set = set( + char for char in sentence.lower() if char.isalpha() + ) return len(unique_letters) == 26 From d4395fa4233bc172bf0bb54404245b266d2caf08 Mon Sep 17 00:00:00 2001 From: Egor Kostan Date: Wed, 3 Sep 2025 15:14:55 -0700 Subject: [PATCH 7/8] Update pangram.py --- pangram/pangram.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/pangram/pangram.py b/pangram/pangram.py index ee388f4..dfe12a4 100644 --- a/pangram/pangram.py +++ b/pangram/pangram.py @@ -1,19 +1,15 @@ """ Pangram. -You work for a company that sells fonts through their website. They'd like to show a -different sentence each time someone views a font on their website. To give a -comprehensive sense of the font, the random sentences should use all the letters -in the English alphabet. +You work for a company that sells fonts through their website. They'd like to +show a different sentence each time someone views a font on their website. +To give a comprehensive sense of the font, the random sentences should use +all the letters in the English alphabet. -They're running a competition to get suggestions for sentences that they can use. -You're in charge of checking the submissions to see if they are valid. +They're running a competition to get suggestions for sentences that they can +use. You're in charge of checking the submissions to see if they are valid. """ -import string - -letters: str = string.ascii_lowercase - def is_pangram(sentence: str) -> bool: """ @@ -21,13 +17,13 @@ def is_pangram(sentence: str) -> bool: :param sentence: The sentence to check for pangram validity :type sentence: str - :return: True if the sentence contains all 26 letters of the English alphabet, False otherwise + :return: True if the sentence contains all 26 letters of the English alphabet, + False otherwise :rtype: bool """ # Empty string if not sentence: return False - # Convert sentence to lowercase and extract unique alphabetic characters unique_letters: set = set( char for char in sentence.lower() if char.isalpha() From 58b542a3ddd03d06284c8eea58b1ec956879b35f Mon Sep 17 00:00:00 2001 From: Egor Kostan Date: Wed, 3 Sep 2025 15:16:12 -0700 Subject: [PATCH 8/8] Update pangram.py --- pangram/pangram.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pangram/pangram.py b/pangram/pangram.py index dfe12a4..3b97811 100644 --- a/pangram/pangram.py +++ b/pangram/pangram.py @@ -13,11 +13,11 @@ def is_pangram(sentence: str) -> bool: """ - Verify that the random sentences uses all the letters in the English alphabet. + Verify that the random sentences uses all the letters in the English. :param sentence: The sentence to check for pangram validity :type sentence: str - :return: True if the sentence contains all 26 letters of the English alphabet, + :return: True if the sentence contains all 26 letters of the English, False otherwise :rtype: bool """