human
Count changes in Led Lights to display digits one by one | Python3 program to count number of on offs to display digits of a number ..
store the led lights required to display a particular number ..
compute the change in led and keep on adding the change.
Driver code"
Solution in Python:
 Give me a code to count changes in Led Lights to display digits one by one and the other steps required?
assistant
#Here is code to count changes in Led Lights to display digits one by one and the other steps required.
 def countOnOff ( n ) :
	Led = [ 6 , 2 , 5 , 5 , 4 , 5 , 6 , 3 , 7 , 5 ]
	leng = len ( n )
	sum = Led [ int ( n [ 0 ] ) - int ( '0' ) ]
	for i in range ( 1 , leng ) :
		sum = ( sum + abs ( Led [ int ( n [ i ] ) - int ( '0' ) ] - Led [ int ( n [ i - 1 ] ) - int ( '0' ) ] ) )
	return sum
if __name__ == ' _ _ main _ _ ' :
	n = "082"
	print ( countOnOff ( n ) )