human
Given a number n , find the first k digits of n ^ n | function that manually calculates n ^ n and then removes digits until k digits remain.
loop will terminate when there are only k digits left.
Driver Code"
Solution in Python:
assistant
#Here is code to given a number n , find the first k digits of n ^ n and the other steps required.
 def firstkdigits ( n , k ) :
	product = 1
	for i in range ( n ) :
		product *= n
	while ( ( product // pow ( 10 , k ) ) != 0 ) :
		product = product // 10
	return product
n = 15
k = 4
print ( firstkdigits ( n , k ) )