In this Python Pattern Printing Programs video tutorial you will learn to print star '*' in Diamond shape.
To print star diamond patterns in python, you have to use three for loops.in that the first loop is responsible for rows and the other two are responsible for columns.In that first for loop is to print stars in pyramid shape or we can say upper body of diamond shape and another for loops is for lower body of diamond shape.
If you are using Python 2 then if you write this code you will get error because in python 2 print is not a function and also we cant use end there so you need to use print as statement and instead of end you need to use coma (,) at the end of print statement to get the same output.
in python 3 you write print like this:
print("*',end="")
in python 2 you need to write:
print "*",
For more free tutorials on computer programming
/ amulsacademy
twitter.com/AmulsAcademy