human
Generate first K multiples of N using Bitwise operators | Function to print the first K multiples of N.
Print the value of N * i.
Iterate each bit of N and add pow ( 2 , pos ) , where pos is the index of each set bit.
Check if current bit at pos j is fixed or not.
For next set bit.
Driver Code"
How can the above be solved in Python?
 ... Write me a code to generate first K multiples of N using Bitwise operators and the other steps required?
assistant
#Here is code to generate first K multiples of N using Bitwise operators and the other steps required.
 def Kmultiples ( n , k ) :
	a = n
	for i in range ( 1 , k + 1 ) :
		print ( " { } ▁ * ▁ { } ▁ = ▁ { } " . format ( n , i , a ) )
		j = 0
		while ( n >= ( 1 << j ) ) :
			a += n & ( 1 << j )
			j += 1
N = 16
K = 7
Kmultiples ( N , K )