human
Program to check if matrix is upper triangular | Function to check matrix is in upper triangular.
Driver function ."
Solution in Python:
assistant
#Here is code to program to check if matrix is upper triangular and the other steps required.
 def isuppertriangular ( M ) :
	for i in range ( 1 , len ( M ) ) :
		for j in range ( 0 , i ) :
			if ( M [ i ] [ j ] != 0 ) :
				return False
	return True
M = [ [ 1 , 3 , 5 , 3 ] , [ 0 , 4 , 6 , 2 ] , [ 0 , 0 , 2 , 5 ] , [ 0 , 0 , 0 , 6 ] ]
if isuppertriangular ( M ) :
	print ( " Yes " )
else :
	print ( " No " )