Python Program To Print Diamond Pattern
In this post, we are going to write a python program to print a diamond pattern of * like this. General idea : To print this diamond, we need to divide the diamond into two parts. One triangle with base down, then the triangle with base upwards. First, we need to print the triangle with base down, the triangle with base up. In the first row of the first triangle with base down, there are 4 spaces and then the * is printed. In the second row of the same triangle, there are 3 spaces and the 3 * are printed. In the third row 2 spaces and 5 * are printed and in the fourth row 1 space and 7 * printed. Finally, in the last row, no space, and 9 * are printed. Here the spaces are decreasing by 1 and no of * increasing by 2. In the first row of the second triangle with base upwards. 1 space and 7 * are printed. In the second row 2 spaces and 5 * printed. Then finally 4 spaces and 1 * are printed. In this one, the number of spaces is increasing by 1, and the number of * is decreasing...