判断一个数是否是4的n次方

时间:2022-10-12 17:47:44
def is_Power_of_four(n):
while n and not (n & 0b11):
n >>=
return (n == ) print(is_Power_of_four())
print(is_Power_of_four())
print(is_Power_of_four())
print(is_Power_of_four())

相关文章