human
Last digit in a power of 2 | Python3 program to find last digit in a power of 2..
Corner case.
Find the shift in current cycle and return value accordingly.
Driver code"
Solution in Python:

=====
Can you provide a code to last digit in a power of 2 and the other steps required?
assistant
#Here is code to last digit in a power of 2 and the other steps required.
 def lastDigit2PowerN ( n ) :
	if n == 0 :
		return 1
	elif n % 4 == 1 :
		return 2
	elif n % 4 == 2 :
		return 4
	elif n % 4 == 3 :
		return 8
	else :
for n in range ( 20 ) :
	print ( lastDigit2PowerN ( n ) , end = " ▁ " )