human
Write me a code to count of different numbers divisible by 3 that can be obtained by changing at most one digit and the other steps required given the following:
Count of different numbers divisible by 3 that can be obtained by changing at most one digit | Function to count the number of possible numbers divisible by 3.
Calculate the sum.
Store the answer.
Iterate over the range.
Decreasing the sum.
Iterate over the range.
Checking if the new sum is divisible by 3 or not.
If yes increment the value of the count.
Given number"
How can the above be solved in Python?
assistant
#Here is code to count of different numbers divisible by 3 that can be obtained by changing at most one digit and the other steps required.
 def findCount ( number ) :
	sum = 0
	for i in range ( len ( number ) ) :
		sum += int ( number [ i ] ) - 48
	count = 0
	for i in range ( len ( number ) ) :
		remaining_sum = sum - ( int ( number [ i ] ) - 48 )
		for j in range ( 10 ) :
			if ( ( remaining_sum + j ) % 3 == 0 and j != int ( number [ i ] ) - 48 ) :
				count += 1
	print ( count )
number = "235"
findCount ( number )