- To print full blank square pattern using *
User Input: 3
Output:
* * * * * * * *
rows=int(input("Enter number of rows : "))
for i in range(1,rows+1):
for j in range(1,rows+1):
if(i==1 or i==rows or j==1 or j==rows):
print("* ", end="")
else:
print(" ", end="")
print("")
Enter number of rows: 6 * * * * * * * * * * * * * * * * * * * *Program
Main Logic :
for i in range(1,rows+1):
for j in range(1,rows+1):
if(i==1 or i==rows or j==1 or j==rows):
print("* ", end="")
else:
print(" ", end="")
print("")
You can print any thing in this pattern, just replace your value with *