Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
crown pattern
#python 3.5.2 # Python implementation to # print Crown pattern # Function to print # crown pattern def crown(length, height) : for i in range(0, height) : for j in range(0, length) : # for first row, print '*' # i.e, for top part of crown if (i == 0) : # print '*' at first, # middle and last column if (j == 0 or j == height or j == length - 1) : print ("*", end = "") else : print (" ", end = "") # print '*' at base of # crown i.e, for last row elif (i == height - 1) : print ("*", end = "") # fill '#' to make # a perfect crown elif ((j < i or j > height - i) and (j < height + i or j >= length - i)) : print ("*", end = "") else : print (" ", end = "") print () # Driver code # length of crown length = 125 # height of crown height = int((length - 1) / 2) # function calling crown(length, height) # This code is contributed by # Deepak
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Lesson6 part b
innerclass.py
wordchangething
Jaan
MBTI test ITA
Game3
recursion for adding 2 numbers
variables.py
decoration dec1
Simple but obfuscated text encrypting
Please log in to post a comment.