Skip to content

Commit 7818f42

Browse files
authored
Merge pull request openAOD#923 from JustAnAverageGuy/sym164
Add symbols 164.
2 parents 027422f + 7b8d005 commit 7818f42

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Symbol Patterns/symbolicpattern164.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
try:
2+
w = int(input("Number of chars in first line (default `5`): "))
3+
c = input("Enter the character for the pattern (default `*`): ")
4+
except ValueError:
5+
print("!! Invalid input, defaults are being used !!")
6+
w = 5
7+
c = '*'
8+
9+
10+
if len(c) == 0: c = '*'
11+
12+
def gen_pattern_164(w:int,char:str) -> str:
13+
s = [(char * i).rjust(w,' ') for i in range(w,0,-2)]
14+
s += s[-2::-1]
15+
return "\n".join(s)
16+
17+
print(gen_pattern_164(w,c))
18+
19+
"""
20+
Number of chars in first line (default `5`): 5
21+
Enter the character for the pattern (default `*`): *
22+
*****
23+
***
24+
*
25+
***
26+
*****
27+
"""

0 commit comments

Comments
 (0)