def is_Power_of_four(n):  
    while n and not (n & 0b11):  
        n >>= 2  
    return (n == 1)  
  
print(is_Power_of_four(4))
print(is_Power_of_four(12))  
print(is_Power_of_four(16))  
print(is_Power_of_four(255))

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2022-01-01
  • 2022-01-11
  • 2021-06-18
  • 2021-09-05
  • 2022-12-23
猜你喜欢
  • 2021-11-22
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-02
相关资源
相似解决方案