From 358d9ddf03b9d838757e63422685697e1d896053 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Pendem Date: Tue, 15 Oct 2024 23:52:00 +0530 Subject: [PATCH 01/14] Create hollow_diamond_alphabets.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the hollow_diamond_alphabet function, which prints a hollow diamond pattern using uppercase alphabet characters based on the specified size. The parameter n determines the number of rows in the diamond. This function uses spaces for alignment and hollow spaces within the diamond structure, creating a visually appealing output. Example: For n=5, the output will be: A B C D E F G H I F G D E B C A Describe your change: Add an algorithm? Yes Fix a bug or typo in an existing algorithm? No Add or change doctests? No Documentation change? No Checklist: I have read CONTRIBUTING.md. This pull request is all my own work — I have not plagiarized. I know that pull requests will not be merged if they fail the automated tests. This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms. All new Python files are placed inside an existing directory. All filenames are in all lowercase characters with no spaces or dashes. All functions and variable names follow Python naming conventions. All function parameters and return values are annotated with Python type hints. All functions have doctests that pass the automated testing. All new algorithms include at least one URL that points to Wikipedia or another similar explanation. --- hollow_diamond_alphabets.py | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 hollow_diamond_alphabets.py diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py new file mode 100644 index 000000000000..4e82e87bdc46 --- /dev/null +++ b/hollow_diamond_alphabets.py @@ -0,0 +1,45 @@ +def hollow_diamond_alphabet(n): + ''' + Prints a hollow diamond pattern using alphabet characters. + + Parameters: + n (int): The size of the diamond. Determines the number of rows. + + Example: + >>> hollow_diamond_alphabet(5) + A + B C + D E + F G + H I + F G + D E + B C + A ''' + + + + + alpha=64 + for i in range(1,n+1): + left_spaces=" "*(n-i) + hollow_spaces=" "*(((i-1)*2)-1) + if(i==1): + print(left_spaces+chr(alpha+1)) + else: + print(left_spaces+chr(alpha)+hollow_spaces+chr(alpha+1)) + alpha+=2 + alpha-=2 + for i in range(n-1,0,-1): + left_spaces=" "*(n-i) + hollow_spaces=" "*(((i-1)*2)-1) + if(i==1): + print(left_spaces+chr(alpha-1)) + else: + print(left_spaces+chr(alpha-2)+hollow_spaces+chr(alpha-1)) + alpha-=2 + + + +n=int(input()) +hollow_diamond_alphabet(n) From 544774c8437441b4ecd844d4028f0ba86968b431 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 18:25:10 +0000 Subject: [PATCH 02/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- hollow_diamond_alphabets.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py index 4e82e87bdc46..5243382c52ac 100644 --- a/hollow_diamond_alphabets.py +++ b/hollow_diamond_alphabets.py @@ -1,10 +1,10 @@ def hollow_diamond_alphabet(n): ''' Prints a hollow diamond pattern using alphabet characters. - + Parameters: n (int): The size of the diamond. Determines the number of rows. - + Example: >>> hollow_diamond_alphabet(5) A @@ -17,7 +17,7 @@ def hollow_diamond_alphabet(n): B C A ''' - + alpha=64 @@ -29,7 +29,7 @@ def hollow_diamond_alphabet(n): else: print(left_spaces+chr(alpha)+hollow_spaces+chr(alpha+1)) alpha+=2 - alpha-=2 + alpha-=2 for i in range(n-1,0,-1): left_spaces=" "*(n-i) hollow_spaces=" "*(((i-1)*2)-1) @@ -37,8 +37,8 @@ def hollow_diamond_alphabet(n): print(left_spaces+chr(alpha-1)) else: print(left_spaces+chr(alpha-2)+hollow_spaces+chr(alpha-1)) - alpha-=2 - + alpha-=2 + n=int(input()) From 71a1ca17973fedde0219d11fbd0b051cc35d1e86 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Pendem Date: Wed, 16 Oct 2024 00:00:05 +0530 Subject: [PATCH 03/14] Update hollow_diamond_alphabets.py Add the hollow_diamond_alphabet function, which prints a hollow diamond pattern using uppercase alphabet characters based on the specified size. The parameter n determines the number of rows in the diamond. This function uses spaces for alignment and hollow spaces within the diamond structure, creating a visually appealing output. --- hollow_diamond_alphabets.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py index 5243382c52ac..9bd66e6824ce 100644 --- a/hollow_diamond_alphabets.py +++ b/hollow_diamond_alphabets.py @@ -22,22 +22,22 @@ def hollow_diamond_alphabet(n): alpha=64 for i in range(1,n+1): - left_spaces=" "*(n-i) - hollow_spaces=" "*(((i-1)*2)-1) - if(i==1): - print(left_spaces+chr(alpha+1)) - else: - print(left_spaces+chr(alpha)+hollow_spaces+chr(alpha+1)) - alpha+=2 + left_spaces=" "*(n-i) + hollow_spaces=" "*(((i-1)*2)-1) + if(i==1): + print(left_spaces+chr(alpha+1)) + else: + print(left_spaces+chr(alpha)+hollow_spaces+chr(alpha+1)) + alpha+=2 alpha-=2 for i in range(n-1,0,-1): - left_spaces=" "*(n-i) - hollow_spaces=" "*(((i-1)*2)-1) - if(i==1): - print(left_spaces+chr(alpha-1)) - else: - print(left_spaces+chr(alpha-2)+hollow_spaces+chr(alpha-1)) - alpha-=2 + left_spaces=" "*(n-i) + hollow_spaces=" "*(((i-1)*2)-1) + if(i==1): + print(left_spaces+chr(alpha-1)) + else: + print(left_spaces+chr(alpha-2)+hollow_spaces+chr(alpha-1)) + alpha-=2 From d379976d1b094c0194a417fc24718ade5dfedf15 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Pendem Date: Wed, 16 Oct 2024 00:01:51 +0530 Subject: [PATCH 04/14] Update hollow_diamond_alphabets.py Add the hollow_diamond_alphabet function, which prints a hollow diamond pattern using uppercase alphabet characters based on the specified size. The parameter n determines the number of rows in the diamond. This function uses spaces for alignment and hollow spaces within the diamond structure, creating a visually appealing output. --- hollow_diamond_alphabets.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py index 9bd66e6824ce..75cc3510f574 100644 --- a/hollow_diamond_alphabets.py +++ b/hollow_diamond_alphabets.py @@ -1,10 +1,8 @@ def hollow_diamond_alphabet(n): ''' Prints a hollow diamond pattern using alphabet characters. - Parameters: n (int): The size of the diamond. Determines the number of rows. - Example: >>> hollow_diamond_alphabet(5) A @@ -15,11 +13,8 @@ def hollow_diamond_alphabet(n): F G D E B C - A ''' - - - - + A + ''' alpha=64 for i in range(1,n+1): left_spaces=" "*(n-i) @@ -38,8 +33,5 @@ def hollow_diamond_alphabet(n): else: print(left_spaces+chr(alpha-2)+hollow_spaces+chr(alpha-1)) alpha-=2 - - - n=int(input()) hollow_diamond_alphabet(n) From f3a1e499ccdcbf281da73184766d7573b7a5c5f1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 18:32:53 +0000 Subject: [PATCH 05/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- hollow_diamond_alphabets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py index 75cc3510f574..7c334ac50eb2 100644 --- a/hollow_diamond_alphabets.py +++ b/hollow_diamond_alphabets.py @@ -13,7 +13,7 @@ def hollow_diamond_alphabet(n): F G D E B C - A + A ''' alpha=64 for i in range(1,n+1): From 5d6f7c2093618fda3699b5e6b81bfaa0e371f7cf Mon Sep 17 00:00:00 2001 From: Manoj Kumar Pendem Date: Wed, 16 Oct 2024 07:40:19 +0530 Subject: [PATCH 06/14] Update hollow_diamond_alphabets.py The hollow_diamond_alphabet function prints a hollow diamond pattern using uppercase alphabet characters based on the specified size. The parameter n determines the number of rows in the diamond. The function utilizes spaces for alignment and hollow spaces within the diamond structure, creating a visually appealing output. This addition enhances the repository by providing a visually interesting pattern generator that can be used for educational purposes or as a coding exercise. --- hollow_diamond_alphabets.py | 68 ++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py index 7c334ac50eb2..86ed574f273e 100644 --- a/hollow_diamond_alphabets.py +++ b/hollow_diamond_alphabets.py @@ -1,37 +1,37 @@ def hollow_diamond_alphabet(n): - ''' - Prints a hollow diamond pattern using alphabet characters. - Parameters: - n (int): The size of the diamond. Determines the number of rows. - Example: - >>> hollow_diamond_alphabet(5) - A - B C - D E - F G - H I - F G - D E - B C - A - ''' - alpha=64 - for i in range(1,n+1): - left_spaces=" "*(n-i) - hollow_spaces=" "*(((i-1)*2)-1) - if(i==1): - print(left_spaces+chr(alpha+1)) - else: - print(left_spaces+chr(alpha)+hollow_spaces+chr(alpha+1)) - alpha+=2 - alpha-=2 - for i in range(n-1,0,-1): - left_spaces=" "*(n-i) - hollow_spaces=" "*(((i-1)*2)-1) - if(i==1): - print(left_spaces+chr(alpha-1)) - else: - print(left_spaces+chr(alpha-2)+hollow_spaces+chr(alpha-1)) - alpha-=2 + ''' + Prints a hollow diamond pattern using alphabet characters. + Parameters: + n (int): The size of the diamond. Determines the number of rows. + Example: + >>> hollow_diamond_alphabet(5) + A + B C + D E + F G + H I + F G + D E + B C + A + ''' + alpha=64 + for i in range(1,n+1): + left_spaces=" "*(n-i) + hollow_spaces=" "*(((i-1)*2)-1) + if(i==1): + print(left_spaces+chr(alpha+1)) + else: + print(left_spaces+chr(alpha)+hollow_spaces+chr(alpha+1)) + alpha+=2 + alpha-=2 + for i in range(n-1,0,-1): + left_spaces=" "*(n-i) + hollow_spaces=" "*(((i-1)*2)-1) + if(i==1): + print(left_spaces+chr(alpha-1)) + else: + print(left_spaces+chr(alpha-2)+hollow_spaces+chr(alpha-1)) + alpha-=2 n=int(input()) hollow_diamond_alphabet(n) From 6740aa9c437edbd8971aa42b007ab659fd08ee4b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 02:11:22 +0000 Subject: [PATCH 07/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- hollow_diamond_alphabets.py | 72 +++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py index 86ed574f273e..ab05acaee62c 100644 --- a/hollow_diamond_alphabets.py +++ b/hollow_diamond_alphabets.py @@ -1,37 +1,39 @@ def hollow_diamond_alphabet(n): - ''' - Prints a hollow diamond pattern using alphabet characters. - Parameters: - n (int): The size of the diamond. Determines the number of rows. - Example: - >>> hollow_diamond_alphabet(5) - A - B C - D E - F G - H I - F G - D E - B C - A - ''' - alpha=64 - for i in range(1,n+1): - left_spaces=" "*(n-i) - hollow_spaces=" "*(((i-1)*2)-1) - if(i==1): - print(left_spaces+chr(alpha+1)) - else: - print(left_spaces+chr(alpha)+hollow_spaces+chr(alpha+1)) - alpha+=2 - alpha-=2 - for i in range(n-1,0,-1): - left_spaces=" "*(n-i) - hollow_spaces=" "*(((i-1)*2)-1) - if(i==1): - print(left_spaces+chr(alpha-1)) - else: - print(left_spaces+chr(alpha-2)+hollow_spaces+chr(alpha-1)) - alpha-=2 -n=int(input()) + """ + Prints a hollow diamond pattern using alphabet characters. + Parameters: + n (int): The size of the diamond. Determines the number of rows. + Example: + >>> hollow_diamond_alphabet(5) + A + B C + D E + F G + H I + F G + D E + B C + A + """ + alpha = 64 + for i in range(1, n + 1): + left_spaces = " " * (n - i) + hollow_spaces = " " * (((i - 1) * 2) - 1) + if i == 1: + print(left_spaces + chr(alpha + 1)) + else: + print(left_spaces + chr(alpha) + hollow_spaces + chr(alpha + 1)) + alpha += 2 + alpha -= 2 + for i in range(n - 1, 0, -1): + left_spaces = " " * (n - i) + hollow_spaces = " " * (((i - 1) * 2) - 1) + if i == 1: + print(left_spaces + chr(alpha - 1)) + else: + print(left_spaces + chr(alpha - 2) + hollow_spaces + chr(alpha - 1)) + alpha -= 2 + + +n = int(input()) hollow_diamond_alphabet(n) From e4541de9354c92763451d9e695d87fa30d3abaca Mon Sep 17 00:00:00 2001 From: Manoj Kumar Pendem Date: Wed, 16 Oct 2024 07:41:56 +0530 Subject: [PATCH 08/14] hollow_diamond_alphabets.py The hollow_diamond_alphabet function prints a hollow diamond pattern using uppercase alphabet characters based on the specified size. The parameter n determines the number of rows in the diamond. The function utilizes spaces for alignment and hollow spaces within the diamond structure, creating a visually appealing output. This addition enhances the repository by providing a visually interesting pattern generator that can be used for educational purposes or as a coding exercise. --- hollow_diamond_alphabets.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py index ab05acaee62c..4a97ea94c8a0 100644 --- a/hollow_diamond_alphabets.py +++ b/hollow_diamond_alphabets.py @@ -1,19 +1,21 @@ -def hollow_diamond_alphabet(n): +def hollow_diamond_alphabet(n: int) -> None: """ Prints a hollow diamond pattern using alphabet characters. - Parameters: - n (int): The size of the diamond. Determines the number of rows. - Example: - >>> hollow_diamond_alphabet(5) - A - B C - D E - F G - H I - F G - D E - B C - A + + Parameters: + n (int): The size of the diamond. Determines the number of rows. + + Example: + >>> hollow_diamond_alphabet(5) + A + B C + D E + F G + H I + F G + D E + B C + A """ alpha = 64 for i in range(1, n + 1): @@ -24,6 +26,7 @@ def hollow_diamond_alphabet(n): else: print(left_spaces + chr(alpha) + hollow_spaces + chr(alpha + 1)) alpha += 2 + alpha -= 2 for i in range(n - 1, 0, -1): left_spaces = " " * (n - i) @@ -34,6 +37,5 @@ def hollow_diamond_alphabet(n): print(left_spaces + chr(alpha - 2) + hollow_spaces + chr(alpha - 1)) alpha -= 2 - -n = int(input()) +n = int(input("Enter the size of the diamond: ")) hollow_diamond_alphabet(n) From 6c92b8d42629fb94c91fc47755f18b9dba92ca25 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 02:12:24 +0000 Subject: [PATCH 09/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- hollow_diamond_alphabets.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py index 4a97ea94c8a0..0ce0e52a4fce 100644 --- a/hollow_diamond_alphabets.py +++ b/hollow_diamond_alphabets.py @@ -1,10 +1,10 @@ def hollow_diamond_alphabet(n: int) -> None: """ Prints a hollow diamond pattern using alphabet characters. - + Parameters: n (int): The size of the diamond. Determines the number of rows. - + Example: >>> hollow_diamond_alphabet(5) A @@ -37,5 +37,6 @@ def hollow_diamond_alphabet(n: int) -> None: print(left_spaces + chr(alpha - 2) + hollow_spaces + chr(alpha - 1)) alpha -= 2 + n = int(input("Enter the size of the diamond: ")) hollow_diamond_alphabet(n) From 1f307e8e963d834ecbac39d3ea9292cfc71f2fb0 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Pendem Date: Wed, 16 Oct 2024 07:43:15 +0530 Subject: [PATCH 10/14] Update hollow_diamond_alphabets.py The hollow_diamond_alphabet function prints a hollow diamond pattern using uppercase alphabet characters based on the specified size. The parameter n determines the number of rows in the diamond. The function utilizes spaces for alignment and hollow spaces within the diamond structure, creating a visually appealing output. --- hollow_diamond_alphabets.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py index 0ce0e52a4fce..8e2299ae6992 100644 --- a/hollow_diamond_alphabets.py +++ b/hollow_diamond_alphabets.py @@ -1,25 +1,25 @@ -def hollow_diamond_alphabet(n: int) -> None: +def hollow_diamond_alphabet(diamond_size: int): """ Prints a hollow diamond pattern using alphabet characters. Parameters: - n (int): The size of the diamond. Determines the number of rows. + diamond_size (int): The size of the diamond. Determines the number of rows. Example: >>> hollow_diamond_alphabet(5) - A - B C - D E - F G - H I - F G - D E - B C - A + A + B C + D E + F G + H I + F G + D E + B C + A """ alpha = 64 - for i in range(1, n + 1): - left_spaces = " " * (n - i) + for i in range(1, diamond_size + 1): + left_spaces = " " * (diamond_size - i) hollow_spaces = " " * (((i - 1) * 2) - 1) if i == 1: print(left_spaces + chr(alpha + 1)) @@ -28,8 +28,8 @@ def hollow_diamond_alphabet(n: int) -> None: alpha += 2 alpha -= 2 - for i in range(n - 1, 0, -1): - left_spaces = " " * (n - i) + for i in range(diamond_size - 1, 0, -1): + left_spaces = " " * (diamond_size - i) hollow_spaces = " " * (((i - 1) * 2) - 1) if i == 1: print(left_spaces + chr(alpha - 1)) @@ -37,6 +37,6 @@ def hollow_diamond_alphabet(n: int) -> None: print(left_spaces + chr(alpha - 2) + hollow_spaces + chr(alpha - 1)) alpha -= 2 - -n = int(input("Enter the size of the diamond: ")) -hollow_diamond_alphabet(n) +# Example usage +diamond_size = int(input("Enter the diamond size: ")) +hollow_diamond_alphabet(diamond_size) From 116e01d71d06f6823a272588c38e2bfce20c50cc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 02:13:41 +0000 Subject: [PATCH 11/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- hollow_diamond_alphabets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py index 8e2299ae6992..7025f91c032a 100644 --- a/hollow_diamond_alphabets.py +++ b/hollow_diamond_alphabets.py @@ -37,6 +37,7 @@ def hollow_diamond_alphabet(diamond_size: int): print(left_spaces + chr(alpha - 2) + hollow_spaces + chr(alpha - 1)) alpha -= 2 + # Example usage diamond_size = int(input("Enter the diamond size: ")) hollow_diamond_alphabet(diamond_size) From d805908b82322ca4283077218f9f98ef7032a148 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Pendem Date: Wed, 16 Oct 2024 07:45:33 +0530 Subject: [PATCH 12/14] Update hollow_diamond_alphabets.py The hollow_diamond_alphabet function prints a hollow diamond pattern using uppercase alphabet characters based on the specified size. The parameter n determines the number of rows in the diamond. The function utilizes spaces for alignment and hollow spaces within the diamond structure, creating a visually appealing output. --- hollow_diamond_alphabets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py index 7025f91c032a..ef265bfde31d 100644 --- a/hollow_diamond_alphabets.py +++ b/hollow_diamond_alphabets.py @@ -1,4 +1,4 @@ -def hollow_diamond_alphabet(diamond_size: int): +def hollow_diamond_alphabet(diamond_size: int) -> None: """ Prints a hollow diamond pattern using alphabet characters. From 286cacf7de56217a7c1f8c7ad8fc94d375cac7c5 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Pendem Date: Wed, 16 Oct 2024 07:47:10 +0530 Subject: [PATCH 13/14] Update hollow_diamond_alphabets.py The hollow_diamond_alphabet function prints a hollow diamond pattern using uppercase alphabet characters based on the specified size. The parameter n determines the number of rows in the diamond. The function utilizes spaces for alignment and hollow spaces within the diamond structure, creating a visually appealing output. --- hollow_diamond_alphabets.py | 1 - 1 file changed, 1 deletion(-) diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py index ef265bfde31d..2da7b7aa96b5 100644 --- a/hollow_diamond_alphabets.py +++ b/hollow_diamond_alphabets.py @@ -37,7 +37,6 @@ def hollow_diamond_alphabet(diamond_size: int) -> None: print(left_spaces + chr(alpha - 2) + hollow_spaces + chr(alpha - 1)) alpha -= 2 - # Example usage diamond_size = int(input("Enter the diamond size: ")) hollow_diamond_alphabet(diamond_size) From d5d06999eae0b8e04a7997ab53f3f814bdfb03c3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 02:17:33 +0000 Subject: [PATCH 14/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- hollow_diamond_alphabets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hollow_diamond_alphabets.py b/hollow_diamond_alphabets.py index 2da7b7aa96b5..ef265bfde31d 100644 --- a/hollow_diamond_alphabets.py +++ b/hollow_diamond_alphabets.py @@ -37,6 +37,7 @@ def hollow_diamond_alphabet(diamond_size: int) -> None: print(left_spaces + chr(alpha - 2) + hollow_spaces + chr(alpha - 1)) alpha -= 2 + # Example usage diamond_size = int(input("Enter the diamond size: ")) hollow_diamond_alphabet(diamond_size)