Run Code
|
Code Wall
|
Users
|
Misc
|
Feedback
|
About
|
Login
|
Theme
|
Privacy
intresting pattern
#python 3.5.2 # Python program to print pattern def StarPattern(height): # This loop prints number of rows for i in range(height): # For every row, first '*' will be # printed Height-rowNumber times. for j in range(height-1,i,-1): print("*",end="") # Print character '*' and Row number # alternately boolean variable to # decide wheather to print char or int printChar = False for j in range(((i*2) +1)): if ( printChar ): print("*",end="") else: print(i + 1,end="") # Each time after printing char # or int reverse the boolean variable # to print alternatively printChar = not printChar # After printing char and int, # it will print '*' for j in range(height-1,i,-1): print("*",end="") print() # Driver code height = 21 StarPattern(height)
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Faiha #4
Merge sort implementation
ALAMOST DONUTZ dungeon
Decimal, Octal, Hexadecimal and Binary Format
quck sort
Q4
Simulare
matrix with random numbers
Basic_if_else.py
wordchangething
Please log in to post a comment.