human
Multiples of 4 ( An Interesting Method ) | Returns true if n is a multiple of 4..
Find XOR of all numbers from 1 to n.
If XOR is equal n , then return true.
Printing multiples of 4 using above method"
How can the above be solved in Python?
assistant
#Here is code to multiples of 4 ( An Interesting Method ) and the other steps required.
 def isMultipleOf4 ( n ) :
	if ( n == 1 ) :
		return False
	XOR = 0
	for i in range ( 1 , n + 1 ) :
		XOR = XOR ^ i
	return ( XOR == n )
for n in range ( 0 , 43 ) :
	if ( isMultipleOf4 ( n ) ) :
		print ( n , end = " ▁ " )