human
Check whether a large number is divisible by 53 or not | Function to check if the number is divisible by 53 or not.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to check whether a large number is divisible by 53 or not and the other steps required.
 def isDivisible ( s ) :
	flag = 0
	while ( len ( s ) > 4 ) :
		l = len ( s ) - 1
		x = ( ord ( s [ l ] ) - ord ( '0' ) ) * 37
		s = s [ : : - 1 ]
		s = s . replace ( '0' , ' ' , 1 )
		i = 0
		carry = 0
		while ( x ) :
			d = ( ( ord ( s [ i ] ) - ord ( '0' ) ) - ( x % 10 ) - carry )
			if ( d < 0 ) :
				d += 10
				carry = 1
			else :
				carry = 0
			s = s . replace ( s [ i ] , chr ( d + ord ( '0' ) ) , 1 )
			x //= 10
			i += 1
		while ( carry and i < l ) :
			d = ( ord ( s [ i ] ) - ord ( '0' ) ) - carry
			if ( d < 0 ) :
				d += 10
				carry = 1
			else :
				carry = 0
			s = s . replace ( s [ i ] , chr ( d + ord ( '0' ) ) , 1 )
			i += 1
		s = s [ : : - 1 ]
	num = 0
	for i in range ( len ( s ) ) :
		num = num * 10 + ( ord ( s [ i ] ) - ord ( '0' ) )
	if ( num % 53 == 0 ) :
		return True
	else :
		return False
if __name__ == ' _ _ main _ _ ' :
	N = "1843246219106"
	if ( isDivisible ( N ) ) :
		print ( " No " )
	else :
		print ( " Yes " )