Created
December 24, 2021 12:31
-
-
Save CodeMaster7000/151fa19c4da3cea3df95d873a48260f2 to your computer and use it in GitHub Desktop.
A Christmas Tree made out of stars. Merry Christmas everyone!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def triangleShape(n): | |
for i in range(n): | |
for j in range(n-i): | |
print(' ', end=' ') | |
for k in range(2*i+1): | |
print('*',end=' ') | |
print() | |
def poleShape(n): | |
for i in range(n): | |
for j in range(n-1): | |
print(' ', end=' ') | |
print('* * *') | |
row = int(input('Enter number of rows: ')) | |
triangleShape(row) | |
triangleShape(row) | |
poleShape(row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment