def f(n): while True: tmp = divmod(n, 2) if tmp[1]!=0: return False if tmp[0]==1: return True n = tmp[0]
python 如何判断给定数值 是否存为2的n次方
原文:http://www.cnblogs.com/yu-zhang/p/3554511.html