Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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.
Guessing game
nameit01.py
Pure Python Square root without using Math.sqrt()
Python, filter emails using finditer()
sen
Ваня и забор
Lesson4
check the browser existence one by one
estadale
Lesson 9 hw
Please log in to post a comment.