DEV Community

Kiruthiga S
Kiruthiga S

Posted on

Python

for row in range (1,8):
    for col in range(1,8):
        if  row == 1 or row == 7 :
            print(" *", end=' ') 
        else:
            print(" ", end=' ')
    print()  
Enter fullscreen mode Exit fullscreen mode
for row in range (1,8):
    for col in range(1,8):
        if  col == 1 or col == 7 :
            print(" *", end=' ') 
        else:
            print(" ", end=' ')
    print()  
Enter fullscreen mode Exit fullscreen mode
for row in range (1,8):
    for col in range(1,8):
        if  row == 1 or row == 7 or col == 1 or col == 7 :
            print("*", end=' ') 
        else:
            print(" ", end=' ')
    print() 
Enter fullscreen mode Exit fullscreen mode
for row in range (1,8):
    for col in range(1,8):
        if  row == 1 or row == 7 or col == 1  :
            print("*", end=' ') 
        else:
            print(" ", end=' ')
    print() 
Enter fullscreen mode Exit fullscreen mode
for row in range (1,8):
    for col in range(1,8):
        if  row == 1 or row == 7 or col == 7  :
            print("*", end=' ') 
        else:
            print(" ", end=' ')
    print() 
Enter fullscreen mode Exit fullscreen mode
for row in range (1,8):
    for col in range(1,8):
        if  row == 1 or col == 1 or col == 7  :
            print("*", end=' ') 
        else:
            print(" ", end=' ')
    print() 
Enter fullscreen mode Exit fullscreen mode
for row in range (1,8):
    for col in range(1,8):
        if  row == 7 or col == 1 or col == 7  :
            print("*", end=' ') 
        else:
            print(" ", end=' ')
    print() 
Enter fullscreen mode Exit fullscreen mode
for row in range (1,8):
    for col in range(1,8):
        if  row==1 or row == 7 or col == 1 or col == 7  :
            if row==1 and col==7 or row==7 and col==1:
                print(" ", end=' ')
            else:
                print("*", end=' ') 
        else:
            print(" ", end=' ')
    print()
Enter fullscreen mode Exit fullscreen mode

Top comments (0)