给定一个整数,编写一个函数来判断它是否是 2 的幂次方。
class Solution: def isPowerOfTwo(self, n: int) -> bool: while n>1: n/=2 return n==1