programplug Logo









PYTHON Examples


(1) Print star pattern.

* * * * * * * * * * * * * * * * * * * * * for i in range(0,7): for j in range(0,i): print('*',end='') print()

(2) Print star pattern.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * for i in range(0,7): for j in range(7,i,-1): print('*',end='') print()

(3) Print star pattern.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * for i in range(0,7): for j in range(0,i): print('*',end='') print() for i in range(0,7): for j in range(7,i,-1): print('*',end='') print()

(4) Print star pattern.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * n=8 for i in range(0,n+1): for k in range(n,i,-1): print(" ",end="") for j in range(0,i): print("* ",end="") print("\r")

(5) Print star pattern.

* * ** * * *** * * * **** * * * * ***** * * * * * ****** * * * * * * ******* * * * * * * * ******** * * * * * * * * ******** * * * * * * * ******** * * * * * * ******* * * * * * ****** * * * * ***** * * * **** * * *** * ** * n=7 for i in range(0,n+1): for k in range(n,i-1,-1): print(" ",end="") for j in range(0,i): print("* ",end="") for w in range(-1,i): print("*",end="") print() n=8 for i in range(0,n+1): for k in range(0,i): print(" ",end="") for j in range(n,i,-1): print("* ",end="") for w in range(9,i,-1): print("*",end="") print()





Our Services

Developing Cheapest Websites
Offer Digital Marketing
Provide College Projects
Attractive Website Developing
Summer Training,Industrial Training
SCO,SMO

Contact Us

Dehradun Uttarakhand India
www.programplug.com
info@programplug.com
08534019974
Designed By : Mridul Gupta

Other Link

About Us

Contact Us

Disclaimer

Privacy Policy