You are viewing a single comment's thread. Return to all comments →
nb=bin(n)[2:] nb=nb.split('0') m=0 for i in nb: if len(i)>m: m=len(i) print(m) ANOTHER CODE n=int(input()) nb=bin(n)[2:] c,m=0,0 for i in range(len(nb)): if nb[i]=='1': c+=1 if c>m: m=c else: c=0 print(m)
Seems like cookies are disabled on this browser, please enable them to open this website
Day 10: Binary Numbers
You are viewing a single comment's thread. Return to all comments →