Rectangle Pattern || Numbers || Pattern || for loop || Python
In this we are going to see how to print the above very simple pattern of numbers, using nested for loops in Python Programming Language.


print("\nEnter the number of rows\n", end='')
rows = int(input())
print("\n", end='')

for i in range(1, rows + 1):
    for j in range(1, rows + 1):
        print(i, end='')
    print("\n", end='')

# Coded by Sahil Shaikh

#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post