Python Program Print Star Pattern 4 – This Python programming tutorial explains the source code of the Python print star pattern program # 4.
********** ********* ******** ******* ****** ***** **** *** ** *
The Source code of Python Program Print Star Pattern 4
# Write a program to display # the following star pattern 4 # using nested for loops # ***** # **** # *** # ** # * # Author: www.EasyCodeBook.com (c) lines = int(input('How many star line in Star Pattern # 4 ?:')) print('The required star pattern is:') sp=2 for i in range(lines,0,-1): for k in range(1,sp): print(' ', end='') for j in range(1,i+1): print('*', end='') print() sp+=1
The output of the Star pattern printing Python Program # 4 is:
How many star line in Star Pattern # 4 ?:10 The required star pattern is: ********** ********* ******** ******* ****** ***** **** *** ** *
Pingback: Python Heart Shape Star Pattern Program | EasyCodeBook.com