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(16))  
print(is_Power_of_four(255))

 

相关文章:

  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2021-10-25
  • 2021-06-13
猜你喜欢
  • 2021-09-05
  • 2021-06-07
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
相关资源
相似解决方案