human
Nicomachu 's Theorem | Python3 program to verify Nicomachu 's Theorem.
Compute sum of cubes.
Check if sum is equal to given formula ..
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to nicomachu 's Theorem and the other steps required.
 def NicomachuTheorum_sum ( n ) :
	sum = 0 ;
	for k in range ( 1 , n + 1 ) :
		sum += k * k * k ;
	triNo = n * ( n + 1 ) / 2 ;
	if ( sum == triNo * triNo ) :
		print ( " Yes " ) ;
	else :
		print ( " No " ) ;
n = 5 ;
NicomachuTheorum_sum ( n ) ;