Python program to print Square Number Pattern

Python program to print the pattern for the given N number of rows:

Input format :
Integer N (Total no. of rows)
Output format :
A pattern with N number of rows and columns
Sample Input:
7
Sample Output for N =  7:
7777777
7777777
7777777
7777777
7777777
7777777
7777777

N = int(input())
i = 0
while i < N:
    j = 0
    while j < N:
        print(str(N), end = (''))
        j = j + 1
    print()
    i = i + 1



Previous Post Next Post