加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
power_of_two.py 325 Bytes
一键复制 编辑 原始数据 按行查看 历史
Vishal Naik 提交于 2020-06-24 15:29 . Fix to meaningful name
# Simple and efficient python program to check whether a number is series of power of two
# Example:
# Input:
# 8
# Output:
# It comes in power series of 2
a = int(input("Enter a number"))
if a & (a - 1) == 0:
print("It comes in power series of 2")
else:
print("It does not come in power series of 2")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化