8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e494efc commit 2c086b3Copy full SHA for 2c086b3
patterns/Pattern-A.py
@@ -0,0 +1,35 @@
1
+__author__ = 'Avinash& 8000 #39;
2
+
3
+# Python3 program to print alphabet A pattern
4
5
+# Function to display alphabet pattern
6
+def print_pattern(n):
7
8
+ # Outer for loop for number of lines(rows)
9
+ for i in range(n):
10
11
+ # Inner for loop for printing *'s and  's(columns)
12
+ for j in range((n // 2) + 1):
13
14
+ # prints two column lines
15
+ if ((j == 0 or j == n //2) and i != 0 or
16
17
+ # print first line of alphabet
18
+ i == 0 and j != 0 and j != n // 2 or
19
20
+ # prints middle line
21
+ i == n // 2):
22
+ print("*", end = "")
23
+ else:
24
+ print(" ", end = "")
25
26
+ print()
27
28
29
+# Size of the letter
30
+num = int(input("Enter the size: \t "))
31
32
+if num > 7:
33
+ print_pattern(num)
34
+else:
35
+ print("Enter a size minumin of 8")
0 commit comments