human
Calculate 7 n / 8 without using division and multiplication operators | Python3 program to evaluate 7 n / 8 without using * and /.
Step 1 ) First multiply number by 7 i . e . 7 n = ( n << 3 ) - n Step 2 ) Divide result by 8.
Driver code"
How can the above be solved in Python?
 Give me a code to calculate 7 n / 8 without using division and multiplication operators and the other steps required?
assistant
#Here is code to calculate 7 n / 8 without using division and multiplication operators and the other steps required.
 def multiplyBySevenByEight ( n ) :
	return ( ( n << 3 ) - n ) >> 3 ;
n = 15 ;
print ( multiplyBySevenByEight ( n ) ) ;