def is_power2(num):

	'states if a number is a power of two'

	return num != 0 and ((num & (num - 1)) == 0)
states if a number is a power of two
recipes/Python/577514_Chek_if_number_power/recipe-577514.py