K-11211 Assignment 5
K-11211 Assignment 5
Department of F. Y. B.Tech
Assignment No: 5
RollNo: 11211
Class: FY B. Tech
Div: K
Batch: K-1
Write a Python program to construct the following pattern, using a nested for loop
11*11
1***1
*****
1***1
11*11
Course Outcome: CO110.2: Make use of various data types, operations, conditions, loops.
Program:
n=5 for i in
range(n): for j in
range(n):
print(1,end=" ")
elif j==2:
Progressive Educa on Society's
Modern College of Engineering, Pune-05.
Department of F. Y. B.Tech
print("*",end=" ")
elif i==2:
2)and(j==0 or j==n-1):
print(1,end=" ")
elif(i==1 or i==n-2):
print("*",end=" ")
else:
print("*",end="