human
Check if a large number is divisible by 75 or not | check divisibleBy3.
to store sum of Digit.
traversing through each digit.
summing up Digit.
check if sumOfDigit is divisibleBy3.
check divisibleBy25.
if a single digit number.
length of the number.
taking the last two digit.
checking if the lastTwo digit is divisibleBy25.
Function to check divisibleBy75 or not.
check if divisibleBy3 and divisibleBy25.
Driver Code.
divisible.
if divisibleBy75"
How can the above be solved in Python?
 ... Write me a code to check if a large number is divisible by 75 or not and the other steps required?
assistant
#Here is code to check if a large number is divisible by 75 or not and the other steps required.
 def divisibleBy3 ( number ) :
	sumOfDigit = 0
	for i in range ( 0 , len ( number ) , 1 ) :
		sumOfDigit += ord ( number [ i ] ) - ord ( '0' )
	if ( sumOfDigit % 3 == 0 ) :
		return True
	return False
def divisibleBy25 ( number ) :
	if ( len ( number ) < 2 ) :
		return False
	length = len ( number )
	lastTwo = ( ( ord ( number [ length - 2 ] ) - ord ( '0' ) ) * 10 + ( ord ( number [ length - 1 ] ) - ord ( '0' ) ) )
	if ( lastTwo % 25 == 0 ) :
		return True
	return False
def divisibleBy75 ( number ) :
	if ( divisibleBy3 ( number ) and divisibleBy25 ( number ) ) :
		return True
	return False
if __name__ == ' _ _ main _ _ ' :
	number = "754586672150"
	divisible = divisibleBy75 ( number )
	if ( divisible ) :
		print ( " Yes " )
	else :
		print ( " No " )