Python example to Print Plus Star Pattern

n = int(input('Enter value of n: '))
for i in range(1,2*n):
    for j in range(1,2*n):
        if i==n or j==n:
            print('*', end='')
        else:
            print(' ', end='')
    print()

OUTPUT:

Enter value of n: 10
         *
         *
         *
         *
         *
         *
         *
         *
         *
*******************
         *
         *
         *
         *
         *
         *
         *
         *
         *

Leave a Comment