Skip to content

Commit d5ab4fe

Browse files
authored
Update Heart pattern in python
This is the code that lets you print a small heart-shaped pattern made from asterisks - "*".
1 parent ed685ea commit d5ab4fe

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pattern/Heart pattern in python

+8-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
1+
n = 6
2+
for row in range(0,n):
3+
for col in range(0, n+1):
4+
if(row==0 and col%3!=0) or (row==1 and col%3==0) or (row-col==2 ) or (row+col==8):
5+
print('*', end=' ')
6+
else:
7+
print(' ' ,end = ' ')
8+
print()

0 commit comments

Comments
 (0)