human
Check if given number contains a digit which is the average of all other digits | Function which checks if a digits exists in n which is the average of all other digits.
Calculate sum of digits in n.
Store digits.
Increase the count of digits in n.
If average of all digits is integer.
Otherwise.
Driver code"
Solution in Python:
 ... Give me a code to check if given number contains a digit which is the average of all other digits and the other steps required?
assistant
#Here is code to check if given number contains a digit which is the average of all other digits and the other steps required.
 def check ( n ) :
	digits = set ( )
	temp = n
	Sum = 0
	count = 0
	while ( temp > 0 ) :
		Sum += temp % 10
		digits . add ( temp % 10 )
		count += 1
		temp = temp // 10
	if ( ( Sum % count == 0 ) and ( ( int ) ( Sum / count ) in digits ) ) :
		print ( " Yes " )
	else :
		print ( " No " )
n = 42644
check ( n )