FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
programminginpython.com/patterns/DiamondPattern.py at master · dedire229/programminginpython.com · GitHub
dedire229
/
programminginpython.com
Public
forked from
avinashn/programminginpython.com
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
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
/
DiamondPattern.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (19 loc) · 345 Bytes
Breadcrumbs
programminginpython.com
/
patterns
/
DiamondPattern.py
Copy path
File metadata and controls
23 lines (19 loc) · 345 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
__author__
=
'Avinash'
# Print a Diamond
# *
# * *
# * * *
# * * * *
# * * * * *
# * * * *
# * * *
# * *
# *
# Range of the diamond
num
=
int
(
input
(
"Enter the range:
\t
"
))
# pyramid
for
p
in
range
(
num
):
print
(
' '
*
(
num
-
p
-
1
)
+
'* '
*
(
p
+
1
))
# reverse pyramid
for
rp
in
range
(
num
-
1
,
0
,
-
1
):
print
(
' '
*
(
num
-
rp
)
+
'* '
*
rp
)
Back
|
FazBrowse Home
|
New Git URL