human
Check a large number is divisible by 16 or not | Function to find that number divisible by 16 or not.
Empty string.
If there is double digit.
If there is triple digit.
If number formed by last four digits is divisible by 16..
Driver code"
How can the above be solved in Python?
 ... What is a code to check a large number is divisible by 16 or not and the other steps required?
assistant
#Here is code to check a large number is divisible by 16 or not and the other steps required.
 def check ( st ) :
	n = len ( st )
	if ( n == 0 and n == 1 ) :
		return False
	if ( n == 2 ) :
		return ( ( int ) ( st [ n - 2 ] ) * 10 + ( ( int ) ( st [ n - 1 ] ) % 16 == 0 ) )
	if ( n == 3 ) :
		return ( ( ( int ) ( st [ n - 3 ] ) * 100 + ( int ) ( st [ n - 2 ] ) * 10 + ( int ) ( st [ n - 1 ] ) ) % 16 == 0 )
	last = ( int ) ( st [ n - 1 ] )
	second_last = ( int ) ( st [ n - 2 ] )
	third_last = ( int ) ( st [ n - 3 ] )
	fourth_last = ( int ) ( st [ n - 4 ] )
	return ( ( fourth_last * 1000 + third_last * 100 + second_last * 10 + last ) % 16 == 0 )
st = "769528"
if ( check ( st ) ) :
	print ( " Yes " )
else :
	print ( " No " )