def f(n): while True: tmp = divmod(n, 2) if tmp[1]!=0: return False if tmp[0]==1: return True n = tmp[0]
def f(n): while True: tmp = divmod(n, 2) if tmp[1]!=0: return False if tmp[0]==1: return True n = tmp[0]
转载于:https://www.cnblogs.com/jeesezhang/p/3554511.html