Power of Four
Given an integer (signed 32 bits), write a function to check whether it is a power of 4.
Example
Input: 16
Output: true
Input: 5
Output: false
Solution
class Solution(object):
def isPowerOfFour(self, num):
"""
:type num: int
:rtype: bool
"""
return num>0 and bin(num).count('1')==1 and bin(num).count('0')%2==1