FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
programminginpython.com/patterns/pattern-b.py at master · standardgalactic/programminginpython.com · GitHub
standardgalactic
/
programminginpython.com
Public
forked from
avinashn/programminginpython.com
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
programminginpython.com
/
patterns
/
pattern-b.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (26 loc) · 861 Bytes
Breadcrumbs
programminginpython.com
/
patterns
/
pattern-b.py
Copy path
File metadata and controls
39 lines (26 loc) · 861 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
__author__
=
'Avinash'
# Python3 program to print alphabet B pattern
# Function to display alphabet pattern
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
+
1
):
# prints two column lines
if
((
j
==
0
or
j
==
n
)
or
# print first line of alphabet
i
==
0
and
j
!=
0
and
j
!=
n
or
# prints last line
i
==
n
-
1
or
# prints middle line
i
==
n
//
2
):
print
(
"*"
,
end
=
""
)
else
:
print
(
" "
,
end
=
""
)
print
()
# Size of the letter
num
=
int
(
input
(
"Enter the size:
\t
"
))
if
num
>
7
:
print_pattern
(
num
)
else
:
print
(
"Enter a size minimum of 8"
)
Back
|
FazBrowse Home
|
New Git URL