Python Heart Shape Star Pattern Program
This Python pattern printing program uses the logic of the following figure. We can see that how the stars are present in certain positions. We will create some conditions on the basis of star posittion in each row.
For example we consider the first row which is zero row. Now zero row has no stars (but space) on position 0,3 and 6. Hence we will create a condition if row==0 and col%3 !=0.
0%3, 3%3 and 6%3 all give 0 as remainder and so a space will be printed at position 0, 3 and 6. A star will be printed otherwise.
Similarly, other conditions are made for remaining row of the heart shape.
** ** * * * * * * * * * *
You may also like:
- C Program Print Heart Shape Star Pattern
- Python Star Pattern Row 1 to 5 Triangle
- C ++ Program Alphabet Triangle Pattern
- Python Program Print Star Pattern 6
- Python Program Print Star Pattern 5
- Python Program Print Star Pattern 4
- Python Program Print Star Pattern 3
- Python Star Pattern Program 2
- Python Star Pattern Program 1
11,611 total views, 24 views today