#Author: A.Polino def is_power2(num): 'states if a number is a power of two' return num != 0 and ((num & (num - 1)) == 0)