Code:
- str="";
- for Row in range(0,7):
- for Col in range(0,7):
- if (Col == 1 or ((Row == 0 or Row == 3) and Col > 0 and Col < 5) or ((Col == 5 or Col == 1) and (Row == 1 or Row == 2))):
- str=str+"*"
- else:
- str=str+" "
- str=str+"\n"
- print(str);
Output:
In this Blog I am printing pattern 'P' using Python.
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegisterMembers onlyeBook · PythonBuild Your Own GPTDownload nowWrite a blog post and earn +250 SHARP when it is approved.
Write a blog
Join the conversation! Your thoughts help the community grow.