通过海量题库、编程比赛和实时排名,系统化提升您的编程能力。
#编写函数,求任意整数的二进制形式中最后连续0的个数。
def demo(n): b_n = bin(n) index = b_n.rfind('1')+1 return len(b_n[index:])