```
class Solution(object):
def isPowerOfTwo(self, n):
"""
:type n: int
:rtype: bool
"""
n = float(n)
if n<1:
return False
if n == 1:
return True
if n>=2:
while n>=2:
n = n/2
if n == 1:
return True
else:
return False
```