Mar-14-2017, 09:06 AM
Just rewrite of wavric's solution:
def is_power(num): return isinstance(num, int) and num > 0 and num & (num - 1) == 0