You are viewing a single comment's thread. Return to all comments →
Here's in Python 3
print(len(max(bin(int(input().strip()))[2:].split('0'))))
working : let input :13 then
print(bin(int(input().strip()))) :gives: 0b1101 print(bin(int(input().strip()))[2:]) :gives: 1101 print(bin(int(input().strip()))[2:].split('0')) :gives: ['11', '1'] print(max(bin(int(input().strip()))[2:].split('0'))) :gives: 11 print(len(max(bin(int(input().strip()))[2:].split('0')))) :gives: 2
print(bin(int(input().strip()))) :gives: 0b1101
print(bin(int(input().strip()))[2:]) :gives: 1101
print(bin(int(input().strip()))[2:].split('0')) :gives: ['11', '1']
print(max(bin(int(input().strip()))[2:].split('0'))) :gives: 11
print(len(max(bin(int(input().strip()))[2:].split('0')))) :gives: 2
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 →
100 % working ,Simple and easy :-)
Here's in Python 3
working : let input :13 then