human
K | Function to find the kth digit from last in an eger n.
If k is less than equal to 0.
Divide the number n by 10 upto k - 1 times.
If the number n is equal 0.
Pr the right most digit.
Driver code.
Given Input.
Function call"
How can the above be solved in Python?

What is a code to k and the other steps required?
assistant
#Here is code to k and the other steps required.
 def kthDigitFromLast ( n , k ) :
	if ( k <= 0 ) :
		print ( " - 1" )
		return
	while ( ( k - 1 ) > 0 and n > 0 ) :
		n = n / 10
		k -= 1
	if ( n == 0 ) :
		print ( " - 1" )
	else :
		print ( int ( n % 10 ) )
if __name__ == ' _ _ main _ _ ' :
	n = 2354
	k = 2
	kthDigitFromLast ( n , k )