Calculate 7 n / 8 without using division and multiplication operators | Python program to evaluate ceil ( 7 n / 8 ) without using * and / ; Note the inner bracket here . This is needed because precedence of ' - ' operator is higher than '<< ; Driver program to test above function
def multiplyBySevenByEight ( n ) : NEW_LINE ' NEW_LINE INDENT return ( n - ( n >> 3 ) ) NEW_LINE DEDENT n = 9 NEW_LINE print ( multiplyBySevenByEight ( n ) ) NEW_LINE