Saturday 28 March 2020

Pattern-1

  

Code 1:

1
2
3
4
5
n=int(input("Enter the number of rows: ")) 
 for j in range(1,n+1): 
       for  i in range(1,n+1):
             print("*",end='')
       print() 


Code 2:
1
2
3
n=int(input("Enter the number of rows: ")) 
for j in range(1,n+1): 
      print('*' * n)


No comments:

Post a Comment