S-Pattern 1:
Code:
- str="";
- for Row in range(0,7):
- for Col in range(0,7):
- if (((Row == 0 or Row == 3 or Row == 6) and Col > 1 and Col < 5) or (Col == 1 and (Row == 1 or Row == 2 or Row == 6)) or (Col == 5 and (Row == 0 or Row == 4 or Row == 5))):
- str=str+"*"
- else:
- str=str+" "
- str=str+"\n"
- print(str);
S-Pattern 1:
Code:
Code:
- row=15
- col=18
- str=""
- for i in range(1,row+1):
- if((i<=3)or(i>=7 and i<=9)or(i>=13 and i<=15)):
- for j in range(1,col):
- str=str+"*"
- str=str+"\n"
- elif(i>=4 and i<=6):
- for j in range(1,5):
- str=str+"*"
- str=str+"\n"
- else:
- for j in range(1,14):
- str=str+" "
- for j in range(1,5):
- str=str+"*"
- str=str+"\n"
- print(str)
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Kapi ShivharePosted Nov 26, 2016, 7:32 AM
Good one thanks for sharing...