Skip to content

Commit a0b39dc

Browse files
committed
Print Pattern of letter F
1 parent 5f2dc31 commit a0b39dc

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

patterns/PatternF.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
__author__ = 'Avinash'
2+
3+
# Python3 program to print alphabet F pattern
4+
5+
# *********
6+
# *
7+
# *
8+
# *
9+
# *********
10+
# *
11+
# *
12+
# *
13+
14+
15+
def print_pattern(n):
16+
# Outer for loop for number of rows
17+
for row in range(n):
18+
19+
# Inner for loop columns
20+
for column in range(n):
21+
22+
# prints first and middle row
23+
if ((row == 0 or row == n // 2) or
24+
25+
# prints first column
26+
column == 0):
27+
print("*", end="")
28+
else:
29+
print(" ", end="")
30+
print()
31+
32+
33+
size = int(input("Enter size: \t"))
34+
35+
if size < 8:
36+
print("Enter a size greater than 8")
37+
else:
38+
print_pattern(size)

0 commit comments

Comments
 (0)