-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
Pattern-C.py
44 lines (32 loc) · 812 Bytes
/
Pattern-C.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
__author__ = 'Avinash'
# Python3 program to print alphabet pattern C
# *********
# *
# *
# *
# *
# *
# *
# *********
def print_pattern(n):
# Outer for loop for number of lines(rows)
for i in range(n):
# Inner for loop for logic execution
for j in range(n + 3):
# Print 1st line
if ((i == 0 or
# Print last line
i == n - 1) and
# For more reasonable curve
j > 0 or
# First column
(j == 0 and (i != 0 and i != n - 1))):
print("*", end="")
else:
print(" ", end="")
print()
num = int(input("Enter size: \t"))
if num > 7:
print_pattern(num)
else:
print("Enter a size minimum of 8")