Print the lower left triangle of a matrix.

Asked: Anonymously |Category: Python

R= int(input("Enter the number of rows:"))

C = int(input("Enter the number of columns:"))


matrix = []

print("Enter the entries rowwise:")



for i in range(R):

a =[]

for j in range(C):

a.append(int(input()))

matrix.append(a)



for i in range(R):

for j in range(C):

print(matrix[i][j], end = " ")

print()


for i in range(0, R):


for j in range(0, C):


if (i < j):


print(" ", end = " ");


else:

print(matrix[i][j],

end = " " );


print(" ");

10 views

Recent Posts

See All

"Believe you can and you're halfway there"